| @@ -77,9 +77,9 @@ | ||
| 77 | 77 | $this->load_dependencies(); |
| 78 | 78 | $this->set_locale(); |
| 79 | 79 | $this->define_admin_hooks(); |
| 80 | 80 | $this->define_public_hooks(); |
| 81 | - | |
| 81 | + $this->define_custom_post_type_hooks(); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Load the required dependencies for this plugin. |
| @@ -127,8 +127,13 @@ | ||
| 127 | 127 | /** |
| 128 | 128 | * The class responsible for showing Poll Maker Welcome page. |
| 129 | 129 | */ |
| 130 | 130 | require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-poll-maker-ays-welcome.php'; |
| 131 | + | |
| 132 | + /** | |
| 133 | + * The class responsible for showing Poll Maker Feedback popup. | |
| 134 | + */ | |
| 135 | + require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-poll-maker-feedback.php'; | |
| 131 | 136 | |
| 132 | 137 | /* |
| 133 | 138 | * The class is responsible for showing polls in wordpress default WP_LIST_TABLE style |
| 134 | 139 | */ |
| @@ -164,8 +169,13 @@ | ||
| 164 | 169 | * The class is responsible for showing poll settings |
| 165 | 170 | */ |
| 166 | 171 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/settings/poll-maker-settings-actions.php'; |
| 167 | 172 | |
| 173 | + /** | |
| 174 | + * The class responsible for defining all functions for getting all custom post type functions | |
| 175 | + */ | |
| 176 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-poll-maker-custom-post-type.php'; | |
| 177 | + | |
| 168 | 178 | // Answer results actions |
| 169 | 179 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/results/poll-maker-ays-answer-results-actions.php'; |
| 170 | 180 | |
| 171 | 181 | $this->loader = new Poll_Maker_Ays_Loader(); |
| @@ -204,8 +214,11 @@ | ||
| 204 | 214 | $this->loader->add_action( 'admin_head', $plugin_admin, 'admin_menu_styles' ); |
| 205 | 215 | $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
| 206 | 216 | $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
| 207 | 217 | $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'disable_scripts', 100); |
| 218 | + $this->loader->add_action('current_screen', $plugin_admin, 'ays_poll_disable_all_notice_from_plugin', 200, 1); | |
| 219 | + $this->loader->add_filter( 'admin_body_class', $plugin_admin, 'ays_poll_add_body_class' ); | |
| 220 | + | |
| 208 | 221 | $this->loader->add_action('widgets_init', $plugin_admin, 'register_poll_ays_widget'); |
| 209 | 222 | |
| 210 | 223 | //Plugin deactivate |
| 211 | 224 | $this->loader->add_action('wp_ajax_apm_deactivate_plugin_option_pm', $plugin_admin, 'apm_deactivate_plugin_option'); |
| @@ -217,9 +230,10 @@ | ||
| 217 | 230 | |
| 218 | 231 | // Add menu item |
| 219 | 232 | $this->loader->add_action('admin_menu', $plugin_admin, 'add_plugin_admin_menu'); |
| 220 | 233 | |
| 221 | - $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_polls_submenu', 90 ); | |
| 234 | + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_dashboard_submenu', 80 ); | |
| 235 | + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_polls_submenu', 85 ); | |
| 222 | 236 | $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_add_new_poll_submenu', 95 ); |
| 223 | 237 | $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_categories_submenu', 100 ); |
| 224 | 238 | $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_results_submenu', 105 ); |
| 225 | 239 | $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_formfields_submenu', 110 ); |
| @@ -237,9 +251,11 @@ | ||
| 237 | 251 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'codemirror_enqueue_scripts'); |
| 238 | 252 | |
| 239 | 253 | // Add footer message |
| 240 | 254 | $this->loader->add_action( 'in_admin_footer', $plugin_admin, 'poll_maker_admin_footer', 1 ); |
| 241 | - | |
| 255 | + $this->loader->add_action( 'in_admin_footer', $plugin_admin, 'ays_poll_add_checklist_guide', 10 ); | |
| 256 | + // $this->loader->add_action( 'in_admin_footer', $plugin_admin, 'ays_poll_black_friady_popup_box', 10 ); | |
| 257 | + | |
| 242 | 258 | // Add aditional links to the plugin |
| 243 | 259 | $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'add_poll_row_meta' , 10 , 2 ); |
| 244 | 260 | |
| 245 | 261 | //Create quick poll |
| @@ -246,20 +262,31 @@ | ||
| 246 | 262 | $this->loader->add_action( 'wp_ajax_ays_poll_maker_quick_start', $plugin_admin, 'ays_poll_maker_quick_start' ); |
| 247 | 263 | $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_maker_quick_start', $plugin_admin, 'ays_poll_maker_quick_start' ); |
| 248 | 264 | |
| 249 | 265 | // Sale Banner |
| 250 | - $this->loader->add_action( 'admin_notices', $plugin_admin, 'ays_poll_sale_baner', 1 ); | |
| 251 | - $this->loader->add_action( 'admin_notices', $plugin_admin, 'display_poll_creation_popup' ); | |
| 266 | + $this->loader->add_action( 'admin_notices', $plugin_admin, 'ays_poll_sale_baner', 10 ); | |
| 252 | 267 | |
| 253 | 268 | $this->loader->add_action( 'wp_ajax_ays_poll_dismiss_button', $plugin_admin, 'ays_poll_dismiss_button' ); |
| 254 | 269 | $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_dismiss_button', $plugin_admin, 'ays_poll_dismiss_button' ); |
| 255 | 270 | |
| 271 | + $this->loader->add_action( 'wp_ajax_ays_poll_install_plugin', $plugin_admin, 'ays_poll_install_plugin' ); | |
| 272 | + $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_install_plugin', $plugin_admin, 'ays_poll_install_plugin' ); | |
| 256 | 273 | |
| 274 | + $this->loader->add_action( 'wp_ajax_ays_poll_activate_plugin', $plugin_admin, 'ays_poll_activate_plugin' ); | |
| 275 | + $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_activate_plugin', $plugin_admin, 'ays_poll_activate_plugin' ); | |
| 276 | + | |
| 257 | 277 | $this->loader->add_action( 'wp_ajax_ays_poll_create_author', $plugin_admin, 'ays_poll_create_author' ); |
| 258 | 278 | $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_create_author', $plugin_admin, 'ays_poll_create_author' ); |
| 259 | - $this->loader->add_action( 'wp_ajax_delete_challenge_box', $plugin_admin, 'delete_challenge_box' ); | |
| 260 | - $this->loader->add_action( 'wp_ajax_nopriv_delete_challenge_box', $plugin_admin, 'delete_challenge_box' ); | |
| 261 | 279 | |
| 280 | + $this->loader->add_action( 'wp_ajax_ays_poll_save_checklist_progress', $plugin_admin, 'ays_poll_save_checklist_progress' ); | |
| 281 | + $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_save_checklist_progress', $plugin_admin, 'ays_poll_save_checklist_progress' ); | |
| 282 | + | |
| 283 | + $this->loader->add_action( 'wp_ajax_ays_poll_checklist_close_popup', $plugin_admin, 'ays_poll_checklist_close_popup' ); | |
| 284 | + $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_checklist_close_popup', $plugin_admin, 'ays_poll_checklist_close_popup' ); | |
| 285 | + | |
| 286 | + $this->loader->add_action( 'wp_ajax_ays_poll_checklist_reopen_callback', $plugin_admin, 'ays_poll_checklist_reopen_callback' ); | |
| 287 | + $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_checklist_reopen_callback', $plugin_admin, 'ays_poll_checklist_reopen_callback' ); | |
| 288 | + | |
| 262 | 289 | } |
| 263 | 290 | |
| 264 | 291 | /** |
| 265 | 292 | * Register all of the hooks related to the public-facing functionality |
| @@ -289,8 +316,17 @@ | ||
| 289 | 316 | $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles_early' ); |
| 290 | 317 | |
| 291 | 318 | $this->loader->add_action( 'wp_ajax_ays_poll_get_user_information', $plugin_public, 'ays_poll_get_user_information' ); |
| 292 | 319 | $this->loader->add_action( 'wp_ajax_nopriv_ays_poll_get_user_information', $plugin_public, 'ays_poll_get_user_information' ); |
| 320 | + } | |
| 321 | + | |
| 322 | + /** | |
| 323 | + * Run the loader to execute all of the hooks with WordPress. | |
| 324 | + * | |
| 325 | + * @since 1.0.0 | |
| 326 | + */ | |
| 327 | + private function define_custom_post_type_hooks(){ | |
| 328 | + $plugin_custom_post_type = new Poll_Maker_Custom_Post_Type( $this->get_plugin_name(), $this->get_version() ); | |
| 293 | 329 | } |
| 294 | 330 | |
| 295 | 331 | /** |
| 296 | 332 | * Run the loader to execute all of the hooks with WordPress. |