views
2 years ago
class-notices-conditions-checker.php
2 years ago
class-release-notice.php
2 weeks ago
class-wp-job-manager-addons-landing-page.php
2 years ago
class-wp-job-manager-addons.php
2 years ago
class-wp-job-manager-admin-notices.php
2 weeks ago
class-wp-job-manager-admin.php
2 months ago
class-wp-job-manager-cpt.php
2 years ago
class-wp-job-manager-permalink-settings.php
2 years ago
class-wp-job-manager-promoted-jobs-admin.php
2 months ago
class-wp-job-manager-settings.php
2 months ago
class-wp-job-manager-setup.php
2 years ago
class-wp-job-manager-taxonomy-meta.php
6 years ago
class-wp-job-manager-writepanels.php
2 years ago
class-release-notice.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * File containing the class \WP_Job_Manager\Admin\Release_Notice. |
| 4 | * |
| 5 | * @package wp-job-manager |
| 6 | */ |
| 7 | |
| 8 | namespace WP_Job_Manager\Admin; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Admin notice about changes and new features introduced in the latest release. |
| 16 | * Update this class for each release to highlight new features or changes. |
| 17 | */ |
| 18 | class Release_Notice { |
| 19 | public const NOTICE_ID = 'release_notice_2_3_0'; |
| 20 | |
| 21 | /** |
| 22 | * Set up notice. |
| 23 | */ |
| 24 | public static function init() { |
| 25 | add_filter( 'wpjm_admin_notices', [ __CLASS__, 'add_release_notice' ] ); |
| 26 | add_action( 'job_manager_action_enable_stats', [ self::class, 'enable_feature' ] ); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Enable the highlighted feature. |
| 31 | * |
| 32 | * @return void |
| 33 | */ |
| 34 | public static function enable_feature() { |
| 35 | \WP_Job_Manager_Settings::instance()->set_setting( \WP_Job_Manager\Stats::OPTION_ENABLE_STATS, '1' ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Add a release notice for the 2.3.0 release. |
| 40 | * |
| 41 | * @param array $notices |
| 42 | * |
| 43 | * @return array |
| 44 | */ |
| 45 | public static function add_release_notice( $notices ) { |
| 46 | |
| 47 | // Make sure to update the version number in the notice ID when changing this notice for a new release. |
| 48 | $action_url = \WP_Job_Manager_Admin_Notices::get_action_url( 'enable_stats', self::NOTICE_ID ); |
| 49 | $notices[ self::NOTICE_ID ] = [ |
| 50 | 'type' => 'site-wide', |
| 51 | 'heading' => 'Job Statistics', |
| 52 | 'message' => '<div>' . __( |
| 53 | ' |
| 54 | <p>Collect analytics about site visitors for each job listing. Display the detailed statistics in the refreshed jobs dashboard.</p> |
| 55 | <ul> |
| 56 | <li>Tracks page views and unique visitors, search impressions and apply button clicks.</li> |
| 57 | <li>Adds a new overlay to the employer dashboard with aggregated statistics and a daily breakdown chart.</li> |
| 58 | <li>Integrates with Job Alerts, Applications, and Bookmarks extensions.</li> |
| 59 | <li>GDPR-compliant, with no personal user information collected.</li> |
| 60 | </ul> |
| 61 | ', |
| 62 | 'wp-job-manager' |
| 63 | ) . '</div>', |
| 64 | 'actions' => [ |
| 65 | [ |
| 66 | 'label' => __( 'Enable', 'wp-job-manager' ), |
| 67 | 'url' => $action_url, |
| 68 | 'primary' => true, |
| 69 | ], |
| 70 | [ |
| 71 | 'label' => __( 'Dismiss', 'wp-job-manager' ), |
| 72 | 'url' => \WP_Job_Manager_Admin_Notices::get_dismiss_url( self::NOTICE_ID ), |
| 73 | 'primary' => false, |
| 74 | ], |
| 75 | ], |
| 76 | 'icon' => false, |
| 77 | 'level' => 'landing', |
| 78 | 'image' => false, |
| 79 | 'dismissible' => false, |
| 80 | 'extra_details' => '', |
| 81 | 'conditions' => [ |
| 82 | [ |
| 83 | 'type' => 'screens', |
| 84 | 'screens' => [ 'edit-job_listing' ], |
| 85 | ], |
| 86 | ], |
| 87 | ]; |
| 88 | |
| 89 | return $notices; |
| 90 | } |
| 91 | |
| 92 | } |
| 93 |