Auto commit: 2026-01-21T16:38:53.243Z
This commit is contained in:
parent
492f6469da
commit
16da92b5f8
25
.htaccess
25
.htaccess
@ -1,18 +1,11 @@
|
|||||||
DirectoryIndex index.php index.html
|
# BEGIN WordPress
|
||||||
Options -Indexes
|
<IfModule mod_rewrite.c>
|
||||||
Options -MultiViews
|
|
||||||
|
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
# 0) Serve existing files/directories as-is
|
RewriteBase /
|
||||||
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
RewriteRule ^index\.php$ - [L]
|
||||||
RewriteCond %{REQUEST_FILENAME} -d
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteRule ^ - [L]
|
|
||||||
|
|
||||||
# 1) Internal map: /page or /page/ -> /page.php (if such PHP file exists)
|
|
||||||
RewriteCond %{REQUEST_FILENAME}.php -f
|
|
||||||
RewriteRule ^(.+?)/?$ $1.php [L]
|
|
||||||
|
|
||||||
# 2) Optional: strip trailing slash for non-directories (keeps .php links working)
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^(.+)/$ $1 [R=301,L]
|
RewriteRule . /index.php [L]
|
||||||
|
</IfModule>
|
||||||
|
# END WordPress
|
||||||
|
|||||||
4
admin_credentials.txt
Normal file
4
admin_credentials.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
WordPress Admin Credentials:
|
||||||
|
URL: http://localhost/wp-admin
|
||||||
|
Username: admin
|
||||||
|
Password: J12AcemJKhEQJTi9
|
||||||
621
restorepoints/1769013269/db.sql
Normal file
621
restorepoints/1769013269/db.sql
Normal file
File diff suppressed because one or more lines are too long
12
wp-content/mu-plugins/bro-styles.php
Normal file
12
wp-content/mu-plugins/bro-styles.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
add_action('wp_head', function() {
|
||||||
|
echo '<style>
|
||||||
|
:root { --wp--preset--color--primary: #FFBF00 !important; }
|
||||||
|
body { background-color: #0A0A0A !important; color: #FFFFFF !important; }
|
||||||
|
.wp-block-post-title a, h1, h2, h3 { color: #FFBF00 !important; font-weight: 900 !important; text-transform: uppercase; }
|
||||||
|
.wp-block-navigation a { color: #FFFFFF !important; font-weight: bold; }
|
||||||
|
.wp-block-navigation a:hover { color: #FFBF00 !important; }
|
||||||
|
.wp-block-button__link { background-color: #FFBF00 !important; color: #000 !important; border-radius: 4px !important; font-weight: bold !important; }
|
||||||
|
footer { border-top: 1px solid #333; padding-top: 20px; }
|
||||||
|
</style>';
|
||||||
|
});
|
||||||
105
wp-content/plugins/bro-beer-reviews/bro-beer-reviews.php
Normal file
105
wp-content/plugins/bro-beer-reviews/bro-beer-reviews.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Plugin Name: Bro Beer Reviews
|
||||||
|
* Description: A rating system for the real bro to rate their brews.
|
||||||
|
* Version: 1.0.0
|
||||||
|
* Author: Real Bro
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register Custom Post Type: Beer Review
|
||||||
|
function bro_register_beer_review_cpt() {
|
||||||
|
$labels = array(
|
||||||
|
'name' => 'Beer Reviews',
|
||||||
|
'singular_name' => 'Beer Review',
|
||||||
|
'menu_name' => 'Beer Reviews',
|
||||||
|
'add_new_item' => 'Add New Beer Review',
|
||||||
|
'edit_item' => 'Edit Beer Review',
|
||||||
|
'new_item' => 'New Beer Review',
|
||||||
|
'view_item' => 'View Beer Review',
|
||||||
|
'search_items' => 'Search Beer Reviews',
|
||||||
|
);
|
||||||
|
|
||||||
|
$args = array(
|
||||||
|
'labels' => $labels,
|
||||||
|
'public' => true,
|
||||||
|
'has_archive' => true,
|
||||||
|
'menu_icon' => 'dashicons-beer',
|
||||||
|
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
|
||||||
|
'rewrite' => array( 'slug' => 'beer-reviews' ),
|
||||||
|
'show_in_rest' => true, // Enable Gutenberg
|
||||||
|
);
|
||||||
|
|
||||||
|
register_post_type( 'beer_review', $args );
|
||||||
|
}
|
||||||
|
add_action( 'init', 'bro_register_beer_review_cpt' );
|
||||||
|
|
||||||
|
// Add Meta Box for Rating
|
||||||
|
function bro_add_beer_rating_meta_box() {
|
||||||
|
add_meta_box(
|
||||||
|
'bro_beer_rating_box',
|
||||||
|
'Bro Rating (1-5 Bottles)',
|
||||||
|
'bro_render_beer_rating_meta_box',
|
||||||
|
'beer_review',
|
||||||
|
'side',
|
||||||
|
'high'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
add_action( 'add_meta_boxes', 'bro_add_beer_rating_meta_box' );
|
||||||
|
|
||||||
|
function bro_render_beer_rating_meta_box( $post ) {
|
||||||
|
$rating = get_post_meta( $post->ID, '_bro_beer_rating', true );
|
||||||
|
wp_nonce_field( 'bro_save_beer_rating', 'bro_beer_rating_nonce' );
|
||||||
|
?>
|
||||||
|
<select name="bro_beer_rating" style="width: 100%;">
|
||||||
|
<?php for ( $i = 1; $i <= 5; $i++ ) : ?>
|
||||||
|
<option value="<?php echo $i; ?>" <?php selected( $rating, $i ); ?>>
|
||||||
|
<?php echo $i; ?> Bottle<?php echo $i > 1 ? 's' : ''; ?>
|
||||||
|
</option>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</select>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save Meta Box Data
|
||||||
|
function bro_save_beer_rating_data( $post_id ) {
|
||||||
|
if ( ! isset( $_POST['bro_beer_rating_nonce'] ) || ! wp_verify_nonce( $_POST['bro_beer_rating_nonce'], 'bro_save_beer_rating' ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $_POST['bro_beer_rating'] ) ) {
|
||||||
|
update_post_meta( $post_id, '_bro_beer_rating', sanitize_text_field( $_POST['bro_beer_rating'] ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'save_post', 'bro_save_beer_rating_data' );
|
||||||
|
|
||||||
|
// Display Rating on Frontend
|
||||||
|
function bro_display_beer_rating( $content ) {
|
||||||
|
if ( is_singular( 'beer_review' ) && in_the_loop() && is_main_query() ) {
|
||||||
|
$rating = get_post_meta( get_the_ID(), '_bro_beer_rating', true );
|
||||||
|
if ( $rating ) {
|
||||||
|
$stars = '';
|
||||||
|
for ( $i = 1; $i <= 5; $i++ ) {
|
||||||
|
$color = $i <= $rating ? '#FFBF00' : '#444';
|
||||||
|
$stars .= '<span style="color:' . $color . '; font-size: 24px; margin-right: 5px;">🍺</span>';
|
||||||
|
}
|
||||||
|
$rating_html = '<div class="bro-beer-rating" style="margin-bottom: 20px; padding: 10px; background: #1a1a1a; border-radius: 8px; border-left: 4px solid #FFBF00;">';
|
||||||
|
$rating_html .= '<strong style="color: #FFBF00; text-transform: uppercase; font-family: sans-serif;">Bro Rating:</strong><br>' . $stars;
|
||||||
|
$rating_html .= '</div>';
|
||||||
|
return $rating_html . $content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
add_filter( 'the_content', 'bro_display_beer_rating' );
|
||||||
Loading…
x
Reference in New Issue
Block a user