| @@ -24,9 +24,8 @@ | ||
| 24 | 24 | add_action( 'current_screen', array( $this, 'disable_propertyhive_meta_box_dragging' ) ); |
| 25 | 25 | add_action( 'current_screen', array( $this, 'remove_propertyhive_meta_boxes_from_screen_options' ) ); |
| 26 | 26 | add_action( 'admin_notices', array( $this, 'review_admin_notices') ); |
| 27 | 27 | add_action( 'admin_notices', array( $this, 'archive_admin_notices' ) ); |
| 28 | - //add_action( 'admin_notices', array( $this, 'retired_template_assistant_admin_notices' ) ); | |
| 29 | 28 | add_action( 'admin_menu', array( $this, 'admin_dashboard_pages' ) ); |
| 30 | 29 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
| 31 | 30 | add_action( 'admin_init', array( $this, 'admin_redirects' ) ); |
| 32 | 31 | add_action( 'admin_init', array( $this, 'prevent_access_to_admin' ) ); |
| @@ -50,11 +49,25 @@ | ||
| 50 | 49 | $post_type_object = get_post_type_object($post_type); |
| 51 | 50 | |
| 52 | 51 | $count = intval($_GET['bulk_archived_posts']); |
| 53 | 52 | |
| 53 | + $message = sprintf( | |
| 54 | + /* translators: 1: number of items, 2: post type label */ | |
| 55 | + _n( | |
| 56 | + '%1$s %2$s moved to archive.', | |
| 57 | + '%1$s %2$s moved to archive.', | |
| 58 | + $count, | |
| 59 | + 'propertyhive' | |
| 60 | + ), | |
| 61 | + number_format_i18n( $count ), | |
| 62 | + $count === 1 | |
| 63 | + ? $post_type_object->labels->singular_name | |
| 64 | + : $post_type_object->labels->name | |
| 65 | + ); | |
| 66 | + | |
| 54 | 67 | printf( |
| 55 | - '<div id="message" class="notice is-dismissible updated"><p>' . _n('%s ' . $post_type_object->labels->singular_name . ' moved to Archive.', '%s ' . $post_type_object->labels->name . ' moved to Archive.', $count, 'propertyhive') . '</p></div>', | |
| 56 | - $count | |
| 68 | + '<div id="message" class="notice is-dismissible updated"><p>%s</p></div>', | |
| 69 | + $message | |
| 57 | 70 | ); |
| 58 | 71 | } |
| 59 | 72 | } |
| 60 | 73 | |
| @@ -66,43 +79,30 @@ | ||
| 66 | 79 | $post_type_object = get_post_type_object($post_type); |
| 67 | 80 | |
| 68 | 81 | $count = intval($_GET['bulk_unarchived_posts']); |
| 69 | 82 | |
| 83 | + $message = sprintf( | |
| 84 | + /* translators: 1: number of items, 2: post type label */ | |
| 85 | + _n( | |
| 86 | + '%1$s %2$s removed from archive.', | |
| 87 | + '%1$s %2$s removed from archive.', | |
| 88 | + $count, | |
| 89 | + 'propertyhive' | |
| 90 | + ), | |
| 91 | + number_format_i18n( $count ), | |
| 92 | + $count === 1 | |
| 93 | + ? $post_type_object->labels->singular_name | |
| 94 | + : $post_type_object->labels->name | |
| 95 | + ); | |
| 96 | + | |
| 70 | 97 | printf( |
| 71 | - '<div id="message" class="notice is-dismissible updated"><p>' . _n('%s ' . $post_type_object->labels->singular_name . ' Removed from Archive.', '%s ' . $post_type_object->labels->name . ' removed from Archive.', $count, 'propertyhive') . '</p></div>', | |
| 72 | - $count | |
| 98 | + '<div id="message" class="notice is-dismissible updated"><p>%s</p></div>', | |
| 99 | + $message | |
| 73 | 100 | ); |
| 74 | 101 | } |
| 75 | 102 | } |
| 76 | 103 | } |
| 77 | 104 | |
| 78 | - public function retired_template_assistant_admin_notices() | |
| 79 | - { | |
| 80 | - if ( is_multisite() ) | |
| 81 | - { | |
| 82 | - $show = (bool)get_site_option( 'propertyhive_template_assistant_retired_notice', 0 ); | |
| 83 | - if ( !$show ) return; | |
| 84 | - if ( !is_super_admin() ) return; | |
| 85 | - } | |
| 86 | - else | |
| 87 | - { | |
| 88 | - $show = (bool)get_option( 'propertyhive_template_assistant_retired_notice', 0 ); | |
| 89 | - if ( !$show ) return; | |
| 90 | - if ( !current_user_can( 'activate_plugins' ) ) return; | |
| 91 | - } | |
| 92 | - | |
| 93 | - echo '<div class="notice notice-info is-dismissible"><p> | |
| 94 | - <strong>' . __('The Template Assistant add-on has been retired.', 'propertyhive' ) . '</strong><br> | |
| 95 | - ' . __('Its functionality is now built into Property Hive under \'Property Hive > Settings > Frontend\'.', 'propertyhive' ) . '<br> | |
| 96 | - ' . __('The add-on has been deactivated to prevent conflicts. No settings were lost.' ) . ' | |
| 97 | - </p> | |
| 98 | - <p> | |
| 99 | - <a href="https://wp-property-hive.com/template-assistant-is-now-part-of-property-hive-core-plugin" target="_blank" class="button button-primary">' . __('Read more', 'propertyhive' ) . '</a> | |
| 100 | - <a href="" class="button" id="ph_dismiss_notice_retired_template_assistant">' . __('Dismiss this notice', 'propertyhive' ) . '</a> | |
| 101 | - </p> | |
| 102 | - </div>'; | |
| 103 | - } | |
| 104 | - | |
| 105 | 105 | public function crm_only_mode_screen_id( $screen_ids ) |
| 106 | 106 | { |
| 107 | 107 | $current_user = wp_get_current_user(); |
| 108 | 108 | |
| @@ -584,9 +584,9 @@ | ||
| 584 | 584 | include_once( 'ph-meta-box-functions.php' ); |
| 585 | 585 | |
| 586 | 586 | // Classes |
| 587 | 587 | include_once( 'class-ph-admin-post-types.php' ); |
| 588 | - //include_once( 'class-ph-admin-taxonomies.php' ); | |
| 588 | + include_once( dirname(PH_PLUGIN_FILE) . '/includes/class-ph-ai-service.php' ); | |
| 589 | 589 | |
| 590 | 590 | // Classes we only need if the ajax is not-ajax |
| 591 | 591 | if ( ! is_ajax() ) { |
| 592 | 592 | include( 'class-ph-admin-menus.php' ); |
| @@ -743,8 +743,9 @@ | ||
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | if ( |
| 746 | 746 | get_option('propertyhive_maps_provider') !== 'osm' && |
| 747 | + get_option('propertyhive_maps_provider') !== 'mapbox' && | |
| 747 | 748 | get_option('propertyhive_google_maps_api_key', '') == '' && |
| 748 | 749 | !isset($_POST['propertyhive_google_maps_api_key']) && |
| 749 | 750 | ( |
| 750 | 751 | !isset($_GET['page']) |
| @@ -757,9 +758,13 @@ | ||
| 757 | 758 | ) |
| 758 | 759 | { |
| 759 | 760 | echo "<div class=\"notice notice-info\" id=\"ph_notice_missing_google_maps_api_key\"> |
| 760 | 761 | <p> |
| 761 | - " . sprintf( __( 'We noticed that you haven\'t entered a Google Maps API key yet. If wishing to display a map on your website it\'s recommended that you <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">create one</a> and <a href="%s">enter it</a>.', 'propertyhive' ), admin_url('admin.php?page=ph-settings&tab=general§ion=map') ) . " | |
| 762 | + " . sprintf( | |
| 763 | + /* translators: %s: URL to plugin settings page where the Google Maps API key can be entered */ | |
| 764 | + __( 'We noticed that you haven\'t entered a Google Maps API key. If wishing to display a map on your website it\'s recommended that you <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">create one</a> and <a href="%s">enter it</a>.', 'propertyhive' ), | |
| 765 | + admin_url('admin.php?page=ph-settings&tab=general§ion=map') | |
| 766 | + ) . " | |
| 762 | 767 | </p> |
| 763 | 768 | <p> |
| 764 | 769 | <a href=\"". esc_url(admin_url('admin.php?page=ph-settings&tab=general§ion=map')) . "\" class=\"button-primary\">" . esc_html(__( 'Enter Google Maps API Key', 'propertyhive' )) . "</a> |
| 765 | 770 | <a href=\"\" class=\"button\" id=\"ph_dismiss_notice_missing_google_maps_api_key\">" . esc_html(__( 'Dismiss', 'propertyhive' )) . "</a> |