| @@ -14,18 +14,18 @@ | ||
| 14 | 14 | global $wp_the_query; |
| 15 | 15 | |
| 16 | 16 | $data = []; |
| 17 | 17 | $actions = []; |
| 18 | - $intro = __( 'Currently Viewing', 'fl-assistant' ); | |
| 18 | + $intro = __( 'Currently Viewing', 'assistant' ); | |
| 19 | 19 | $type = ''; |
| 20 | - $name = __( 'Untitled', 'fl-assistant' ); | |
| 20 | + $name = __( 'Untitled', 'assistant' ); | |
| 21 | 21 | |
| 22 | 22 | $obj = get_queried_object(); |
| 23 | 23 | |
| 24 | 24 | if ( is_admin() ) { |
| 25 | 25 | |
| 26 | - $intro = __( 'Currently Viewing Admin Page', 'fl-assistant' ); | |
| 27 | - $type = __( 'Admin Page', 'fl-assistant' ); | |
| 26 | + $intro = __( 'Currently Viewing Admin Page', 'assistant' ); | |
| 27 | + $type = __( 'Admin Page', 'assistant' ); | |
| 28 | 28 | $screen = get_current_screen(); |
| 29 | 29 | $name = $screen->id; |
| 30 | 30 | |
| 31 | 31 | } else { |
| @@ -30,28 +30,28 @@ | ||
| 30 | 30 | |
| 31 | 31 | } else { |
| 32 | 32 | |
| 33 | 33 | if ( is_404() ) { |
| 34 | - $name = __( 'Page Not Found', 'fl-assistant' ); | |
| 35 | - $type = __( '404', 'fl-assistant' ); | |
| 34 | + $name = __( 'Page Not Found', 'assistant' ); | |
| 35 | + $type = __( '404', 'assistant' ); | |
| 36 | 36 | |
| 37 | 37 | } elseif ( is_search() ) { |
| 38 | 38 | |
| 39 | - $intro = __( 'Currently Viewing Search Results For', 'fl-assistant' ); | |
| 40 | - $type = __( 'Search Results For:', 'fl-assistant' ); | |
| 39 | + $intro = __( 'Currently Viewing Search Results For', 'assistant' ); | |
| 40 | + $type = __( 'Search Results For:', 'assistant' ); | |
| 41 | 41 | $name = get_search_query(); |
| 42 | 42 | |
| 43 | 43 | } elseif ( is_date() ) { |
| 44 | 44 | |
| 45 | - $intro = __( 'Currently Viewing Date Archive', 'fl-assistant' ); | |
| 46 | - $type = __( 'Date Archive', 'fl-assistant' ); | |
| 45 | + $intro = __( 'Currently Viewing Date Archive', 'assistant' ); | |
| 46 | + $type = __( 'Date Archive', 'assistant' ); | |
| 47 | 47 | $name = get_the_date(); |
| 48 | 48 | |
| 49 | 49 | } elseif ( is_post_type_archive() ) { |
| 50 | 50 | |
| 51 | 51 | $post_type = get_post_type_object( 'post' ); |
| 52 | - $intro = __( 'Currently Viewing Post Type Archive', 'fl-assistant' ); | |
| 53 | - $type = __( 'Post Type Archive', 'fl-assistant' ); | |
| 52 | + $intro = __( 'Currently Viewing Post Type Archive', 'assistant' ); | |
| 53 | + $type = __( 'Post Type Archive', 'assistant' ); | |
| 54 | 54 | $name = $post_type->labels->singular_name; |
| 55 | 55 | |
| 56 | 56 | } elseif ( is_tax() || is_category() || is_tag() ) { |
| 57 | 57 | |
| @@ -57,9 +57,9 @@ | ||
| 57 | 57 | |
| 58 | 58 | $tax = get_taxonomy( $obj->taxonomy ); |
| 59 | 59 | $labels = $tax->labels; |
| 60 | 60 | |
| 61 | - $intro = sprintf( esc_html__( 'Currently Viewing %s', 'fl-assistant' ), $labels->singular_name ); | |
| 61 | + $intro = sprintf( esc_html__( 'Currently Viewing %s', 'assistant' ), $labels->singular_name ); | |
| 62 | 62 | $type = $labels->singular_name; |
| 63 | 63 | $name = $obj->name; |
| 64 | 64 | |
| 65 | 65 | $actions[] = [ |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | |
| 74 | 74 | $post_type = get_post_type_object( get_post_type() ); |
| 75 | 75 | $labels = $post_type->labels; |
| 76 | 76 | $post_type = $labels->singular_name; |
| 77 | - $intro = sprintf( esc_html__( 'Currently Viewing %s', 'fl-assistant' ), $post_type ); | |
| 77 | + $intro = sprintf( esc_html__( 'Currently Viewing %s', 'assistant' ), $post_type ); | |
| 78 | 78 | $type = $post_type; |
| 79 | 79 | $name = $obj->post_title; |
| 80 | 80 | |
| 81 | 81 | $actions[] = [ |
| @@ -103,16 +103,16 @@ | ||
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } elseif ( is_author() ) { |
| 106 | 106 | |
| 107 | - $intro = __( 'Currently Viewing Author', 'fl-assistant' ); | |
| 108 | - $type = __( 'Author Archive', 'fl-assistant' ); | |
| 107 | + $intro = __( 'Currently Viewing Author', 'assistant' ); | |
| 108 | + $type = __( 'Author Archive', 'assistant' ); | |
| 109 | 109 | $name = wp_get_current_user()->display_name; |
| 110 | 110 | |
| 111 | 111 | } elseif ( is_front_page() ) { |
| 112 | - $intro = __( 'Currently Viewing Post Archive', 'fl-assistant' ); | |
| 113 | - $type = __( 'Post Archive', 'fl-assistant' ); | |
| 114 | - $name = __( 'Latest Posts', 'fl-assistant' ); | |
| 112 | + $intro = __( 'Currently Viewing Post Archive', 'assistant' ); | |
| 113 | + $type = __( 'Post Archive', 'assistant' ); | |
| 114 | + $name = __( 'Latest Posts', 'assistant' ); | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $data['intro'] = $intro; |
| @@ -263,9 +263,9 @@ | ||
| 263 | 263 | */ |
| 264 | 264 | public function is_local() { |
| 265 | 265 | $ips = [ '127.0.0.1', '::1' ]; |
| 266 | 266 | $domain = '.local'; |
| 267 | - if ( ! in_array( $_SERVER['REMOTE_ADDR'], $ips, true ) ) { | |
| 267 | + if ( isset( $_SERVER['REMOTE_ADDR'] ) && ! in_array( $_SERVER['REMOTE_ADDR'], $ips, true ) ) { | |
| 268 | 268 | return substr_compare( $_SERVER['SERVER_NAME'], $domain, -strlen( $domain ) ) === 0; |
| 269 | 269 | } |
| 270 | 270 | return true; |
| 271 | 271 | } |