@@ -8,98 +8,98 @@ |
||
| 8 | 8 | |
| 9 | 9 | class WelcomeController extends Controller |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * @return array |
|
| 13 | - * @filter plugin_action_links_site-reviews/site-reviews.php |
|
| 14 | - */ |
|
| 15 | - public function filterActionLinks(array $links) |
|
| 16 | - { |
|
| 17 | - $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
| 18 | - 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
| 19 | - ]); |
|
| 20 | - return $links; |
|
| 21 | - } |
|
| 11 | + /** |
|
| 12 | + * @return array |
|
| 13 | + * @filter plugin_action_links_site-reviews/site-reviews.php |
|
| 14 | + */ |
|
| 15 | + public function filterActionLinks(array $links) |
|
| 16 | + { |
|
| 17 | + $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
| 18 | + 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
| 19 | + ]); |
|
| 20 | + return $links; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @return string |
|
| 25 | - * @filter admin_title |
|
| 26 | - */ |
|
| 27 | - public function filterAdminTitle($title) |
|
| 28 | - { |
|
| 29 | - return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
|
| 30 | - ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
| 31 | - : $title; |
|
| 32 | - } |
|
| 23 | + /** |
|
| 24 | + * @return string |
|
| 25 | + * @filter admin_title |
|
| 26 | + */ |
|
| 27 | + public function filterAdminTitle($title) |
|
| 28 | + { |
|
| 29 | + return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
|
| 30 | + ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
| 31 | + : $title; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @param string $text |
|
| 36 | - * @return string |
|
| 37 | - * @filter admin_footer_text |
|
| 38 | - */ |
|
| 39 | - public function filterFooterText($text) |
|
| 40 | - { |
|
| 41 | - if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
| 42 | - return $text; |
|
| 43 | - } |
|
| 44 | - $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
|
| 45 | - return wp_kses_post(sprintf( |
|
| 46 | - __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
| 47 | - '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
|
| 48 | - '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
|
| 49 | - )); |
|
| 50 | - } |
|
| 34 | + /** |
|
| 35 | + * @param string $text |
|
| 36 | + * @return string |
|
| 37 | + * @filter admin_footer_text |
|
| 38 | + */ |
|
| 39 | + public function filterFooterText($text) |
|
| 40 | + { |
|
| 41 | + if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
| 42 | + return $text; |
|
| 43 | + } |
|
| 44 | + $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
|
| 45 | + return wp_kses_post(sprintf( |
|
| 46 | + __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
| 47 | + '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
|
| 48 | + '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
|
| 49 | + )); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @param string $plugin |
|
| 54 | - * @param bool $isNetworkActivation |
|
| 55 | - * @return void |
|
| 56 | - * @action activated_plugin |
|
| 57 | - */ |
|
| 58 | - public function redirectOnActivation($plugin, $isNetworkActivation) |
|
| 59 | - { |
|
| 60 | - if (!$isNetworkActivation |
|
| 61 | - && 'cli' !== php_sapi_name() |
|
| 62 | - && $plugin === plugin_basename(glsr()->file)) { |
|
| 63 | - wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
| 64 | - exit; |
|
| 65 | - } |
|
| 66 | - } |
|
| 52 | + /** |
|
| 53 | + * @param string $plugin |
|
| 54 | + * @param bool $isNetworkActivation |
|
| 55 | + * @return void |
|
| 56 | + * @action activated_plugin |
|
| 57 | + */ |
|
| 58 | + public function redirectOnActivation($plugin, $isNetworkActivation) |
|
| 59 | + { |
|
| 60 | + if (!$isNetworkActivation |
|
| 61 | + && 'cli' !== php_sapi_name() |
|
| 62 | + && $plugin === plugin_basename(glsr()->file)) { |
|
| 63 | + wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
| 64 | + exit; |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * @return void |
|
| 70 | - * @action admin_menu |
|
| 71 | - */ |
|
| 72 | - public function registerPage() |
|
| 73 | - { |
|
| 74 | - add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
| 75 | - sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
| 76 | - glsr()->name, |
|
| 77 | - glsr()->getPermission('welcome'), |
|
| 78 | - 'welcome', |
|
| 79 | - [$this, 'renderPage'] |
|
| 80 | - ); |
|
| 81 | - remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
| 82 | - } |
|
| 68 | + /** |
|
| 69 | + * @return void |
|
| 70 | + * @action admin_menu |
|
| 71 | + */ |
|
| 72 | + public function registerPage() |
|
| 73 | + { |
|
| 74 | + add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
| 75 | + sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
| 76 | + glsr()->name, |
|
| 77 | + glsr()->getPermission('welcome'), |
|
| 78 | + 'welcome', |
|
| 79 | + [$this, 'renderPage'] |
|
| 80 | + ); |
|
| 81 | + remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @return void |
|
| 86 | - * @see $this->registerPage() |
|
| 87 | - * @callback add_submenu_page |
|
| 88 | - */ |
|
| 89 | - public function renderPage() |
|
| 90 | - { |
|
| 91 | - $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
| 92 | - 'getting-started' => __('Getting Started', 'site-reviews'), |
|
| 93 | - 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
| 94 | - 'support' => __('Support', 'site-reviews'), |
|
| 95 | - ]); |
|
| 96 | - glsr()->render('pages/welcome/index', [ |
|
| 97 | - 'data' => [ |
|
| 98 | - 'context' => [], |
|
| 99 | - ], |
|
| 100 | - 'http_referer' => (string) wp_get_referer(), |
|
| 101 | - 'tabs' => $tabs, |
|
| 102 | - 'template' => glsr(Template::class), |
|
| 103 | - ]); |
|
| 104 | - } |
|
| 84 | + /** |
|
| 85 | + * @return void |
|
| 86 | + * @see $this->registerPage() |
|
| 87 | + * @callback add_submenu_page |
|
| 88 | + */ |
|
| 89 | + public function renderPage() |
|
| 90 | + { |
|
| 91 | + $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
| 92 | + 'getting-started' => __('Getting Started', 'site-reviews'), |
|
| 93 | + 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
| 94 | + 'support' => __('Support', 'site-reviews'), |
|
| 95 | + ]); |
|
| 96 | + glsr()->render('pages/welcome/index', [ |
|
| 97 | + 'data' => [ |
|
| 98 | + 'context' => [], |
|
| 99 | + ], |
|
| 100 | + 'http_referer' => (string) wp_get_referer(), |
|
| 101 | + 'tabs' => $tabs, |
|
| 102 | + 'template' => glsr(Template::class), |
|
| 103 | + ]); |
|
| 104 | + } |
|
| 105 | 105 | } |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | * @return array |
| 13 | 13 | * @filter plugin_action_links_site-reviews/site-reviews.php |
| 14 | 14 | */ |
| 15 | - public function filterActionLinks(array $links) |
|
| 15 | + public function filterActionLinks( array $links ) |
|
| 16 | 16 | { |
| 17 | - $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
| 18 | - 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
| 19 | - ]); |
|
| 17 | + $links['welcome'] = glsr( Builder::class )->a( __( 'About', 'site-reviews' ), [ |
|
| 18 | + 'href' => admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ), |
|
| 19 | + ] ); |
|
| 20 | 20 | return $links; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | * @return string |
| 25 | 25 | * @filter admin_title |
| 26 | 26 | */ |
| 27 | - public function filterAdminTitle($title) |
|
| 27 | + public function filterAdminTitle( $title ) |
|
| 28 | 28 | { |
| 29 | 29 | return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
| 30 | - ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
| 30 | + ? sprintf( __( 'Welcome to %s — WordPress', 'site-reviews' ), glsr()->name ) |
|
| 31 | 31 | : $title; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -36,17 +36,17 @@ discard block |
||
| 36 | 36 | * @return string |
| 37 | 37 | * @filter admin_footer_text |
| 38 | 38 | */ |
| 39 | - public function filterFooterText($text) |
|
| 39 | + public function filterFooterText( $text ) |
|
| 40 | 40 | { |
| 41 | - if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
| 41 | + if( Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id ) { |
|
| 42 | 42 | return $text; |
| 43 | 43 | } |
| 44 | 44 | $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
| 45 | - return wp_kses_post(sprintf( |
|
| 46 | - __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
| 45 | + return wp_kses_post( sprintf( |
|
| 46 | + __( 'Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews' ), |
|
| 47 | 47 | '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
| 48 | 48 | '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
| 49 | - )); |
|
| 49 | + ) ); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | * @return void |
| 56 | 56 | * @action activated_plugin |
| 57 | 57 | */ |
| 58 | - public function redirectOnActivation($plugin, $isNetworkActivation) |
|
| 58 | + public function redirectOnActivation( $plugin, $isNetworkActivation ) |
|
| 59 | 59 | { |
| 60 | - if (!$isNetworkActivation |
|
| 60 | + if( !$isNetworkActivation |
|
| 61 | 61 | && 'cli' !== php_sapi_name() |
| 62 | - && $plugin === plugin_basename(glsr()->file)) { |
|
| 63 | - wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
| 62 | + && $plugin === plugin_basename( glsr()->file ) ) { |
|
| 63 | + wp_safe_redirect( admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ) ); |
|
| 64 | 64 | exit; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function registerPage() |
| 73 | 73 | { |
| 74 | - add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
| 75 | - sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
| 74 | + add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, |
|
| 75 | + sprintf( __( 'Welcome to %s', 'site-reviews' ), glsr()->name ), |
|
| 76 | 76 | glsr()->name, |
| 77 | - glsr()->getPermission('welcome'), |
|
| 77 | + glsr()->getPermission( 'welcome' ), |
|
| 78 | 78 | 'welcome', |
| 79 | 79 | [$this, 'renderPage'] |
| 80 | 80 | ); |
| 81 | - remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
| 81 | + remove_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, 'welcome' ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -88,18 +88,18 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function renderPage() |
| 90 | 90 | { |
| 91 | - $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
| 92 | - 'getting-started' => __('Getting Started', 'site-reviews'), |
|
| 93 | - 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
| 94 | - 'support' => __('Support', 'site-reviews'), |
|
| 95 | - ]); |
|
| 96 | - glsr()->render('pages/welcome/index', [ |
|
| 91 | + $tabs = apply_filters( 'site-reviews/addon/welcome/tabs', [ |
|
| 92 | + 'getting-started' => __( 'Getting Started', 'site-reviews' ), |
|
| 93 | + 'whatsnew' => __( 'What\'s New', 'site-reviews' ), |
|
| 94 | + 'support' => __( 'Support', 'site-reviews' ), |
|
| 95 | + ] ); |
|
| 96 | + glsr()->render( 'pages/welcome/index', [ |
|
| 97 | 97 | 'data' => [ |
| 98 | 98 | 'context' => [], |
| 99 | 99 | ], |
| 100 | - 'http_referer' => (string) wp_get_referer(), |
|
| 100 | + 'http_referer' => (string)wp_get_referer(), |
|
| 101 | 101 | 'tabs' => $tabs, |
| 102 | - 'template' => glsr(Template::class), |
|
| 103 | - ]); |
|
| 102 | + 'template' => glsr( Template::class ), |
|
| 103 | + ] ); |
|
| 104 | 104 | } |
| 105 | 105 | } |
@@ -19,105 +19,105 @@ |
||
| 19 | 19 | |
| 20 | 20 | class Actions implements HooksContract |
| 21 | 21 | { |
| 22 | - protected $about; |
|
| 23 | - protected $admin; |
|
| 24 | - protected $app; |
|
| 25 | - protected $blocks; |
|
| 26 | - protected $console; |
|
| 27 | - protected $editor; |
|
| 28 | - protected $listtable; |
|
| 29 | - protected $menu; |
|
| 30 | - protected $main; |
|
| 31 | - protected $public; |
|
| 32 | - protected $rebusify; |
|
| 33 | - protected $review; |
|
| 34 | - protected $router; |
|
| 35 | - protected $settings; |
|
| 36 | - protected $taxonomy; |
|
| 37 | - protected $welcome; |
|
| 22 | + protected $about; |
|
| 23 | + protected $admin; |
|
| 24 | + protected $app; |
|
| 25 | + protected $blocks; |
|
| 26 | + protected $console; |
|
| 27 | + protected $editor; |
|
| 28 | + protected $listtable; |
|
| 29 | + protected $menu; |
|
| 30 | + protected $main; |
|
| 31 | + protected $public; |
|
| 32 | + protected $rebusify; |
|
| 33 | + protected $review; |
|
| 34 | + protected $router; |
|
| 35 | + protected $settings; |
|
| 36 | + protected $taxonomy; |
|
| 37 | + protected $welcome; |
|
| 38 | 38 | |
| 39 | - public function __construct(Application $app ) { |
|
| 40 | - $this->app = $app; |
|
| 41 | - $this->admin = $app->make(AdminController::class); |
|
| 42 | - $this->blocks = $app->make(BlocksController::class); |
|
| 43 | - $this->console = $app->make(Console::class); |
|
| 44 | - $this->editor = $app->make(EditorController::class); |
|
| 45 | - $this->listtable = $app->make(ListTableController::class); |
|
| 46 | - $this->main = $app->make(MainController::class); |
|
| 47 | - $this->menu = $app->make(MenuController::class); |
|
| 48 | - $this->public = $app->make(PublicController::class); |
|
| 49 | - $this->rebusify = $app->make(RebusifyController::class); |
|
| 50 | - $this->review = $app->make(ReviewController::class); |
|
| 51 | - $this->router = $app->make(Router::class); |
|
| 52 | - $this->settings = $app->make(SettingsController::class); |
|
| 53 | - $this->taxonomy = $app->make(TaxonomyController::class); |
|
| 54 | - $this->welcome = $app->make(WelcomeController::class); |
|
| 55 | - } |
|
| 39 | + public function __construct(Application $app ) { |
|
| 40 | + $this->app = $app; |
|
| 41 | + $this->admin = $app->make(AdminController::class); |
|
| 42 | + $this->blocks = $app->make(BlocksController::class); |
|
| 43 | + $this->console = $app->make(Console::class); |
|
| 44 | + $this->editor = $app->make(EditorController::class); |
|
| 45 | + $this->listtable = $app->make(ListTableController::class); |
|
| 46 | + $this->main = $app->make(MainController::class); |
|
| 47 | + $this->menu = $app->make(MenuController::class); |
|
| 48 | + $this->public = $app->make(PublicController::class); |
|
| 49 | + $this->rebusify = $app->make(RebusifyController::class); |
|
| 50 | + $this->review = $app->make(ReviewController::class); |
|
| 51 | + $this->router = $app->make(Router::class); |
|
| 52 | + $this->settings = $app->make(SettingsController::class); |
|
| 53 | + $this->taxonomy = $app->make(TaxonomyController::class); |
|
| 54 | + $this->welcome = $app->make(WelcomeController::class); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @return void |
|
| 59 | - */ |
|
| 60 | - public function run() |
|
| 61 | - { |
|
| 62 | - add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
| 63 | - add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
| 64 | - add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
| 65 | - add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
| 66 | - add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
| 67 | - add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
| 68 | - add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
| 69 | - add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
| 70 | - add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
| 71 | - add_action('init', [$this->blocks, 'registerBlocks']); |
|
| 72 | - add_action('admin_footer', [$this->console, 'logOnce']); |
|
| 73 | - add_action('wp_footer', [$this->console, 'logOnce']); |
|
| 74 | - add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
| 75 | - add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
| 76 | - add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
| 77 | - add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
| 78 | - add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
| 79 | - add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
| 80 | - add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
| 81 | - add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
| 82 | - add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes']); |
|
| 83 | - add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
| 84 | - add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
| 85 | - add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
| 86 | - add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
| 87 | - add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
| 88 | - add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
| 89 | - add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
| 90 | - add_action('init', [$this->main, 'registerPostType'], 8); |
|
| 91 | - add_action('init', [$this->main, 'registerShortcodes']); |
|
| 92 | - add_action('init', [$this->main, 'registerTaxonomy']); |
|
| 93 | - add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
| 94 | - add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
| 95 | - add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
| 96 | - add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
| 97 | - add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
| 98 | - add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
| 99 | - add_action('wp_footer', [$this->public, 'renderSchema']); |
|
| 100 | - add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
| 101 | - add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
| 102 | - add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
| 103 | - add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4); |
|
| 104 | - add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
| 105 | - add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
| 106 | - add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
| 107 | - add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
| 108 | - add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
| 109 | - add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
| 110 | - add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
| 111 | - add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
| 112 | - add_action('init', [$this->router, 'routePublicPostRequest']); |
|
| 113 | - add_action('admin_init', [$this->settings, 'registerSettings']); |
|
| 114 | - add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
| 115 | - add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
| 116 | - add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
| 117 | - add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
| 118 | - add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
| 119 | - add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
| 120 | - add_action('activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2); |
|
| 121 | - add_action('admin_menu', [$this->welcome, 'registerPage']); |
|
| 122 | - } |
|
| 57 | + /** |
|
| 58 | + * @return void |
|
| 59 | + */ |
|
| 60 | + public function run() |
|
| 61 | + { |
|
| 62 | + add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
| 63 | + add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
| 64 | + add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
| 65 | + add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
| 66 | + add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
| 67 | + add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
| 68 | + add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
| 69 | + add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
| 70 | + add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
| 71 | + add_action('init', [$this->blocks, 'registerBlocks']); |
|
| 72 | + add_action('admin_footer', [$this->console, 'logOnce']); |
|
| 73 | + add_action('wp_footer', [$this->console, 'logOnce']); |
|
| 74 | + add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
| 75 | + add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
| 76 | + add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
| 77 | + add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
| 78 | + add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
| 79 | + add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
| 80 | + add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
| 81 | + add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
| 82 | + add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes']); |
|
| 83 | + add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
| 84 | + add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
| 85 | + add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
| 86 | + add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
| 87 | + add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
| 88 | + add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
| 89 | + add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
| 90 | + add_action('init', [$this->main, 'registerPostType'], 8); |
|
| 91 | + add_action('init', [$this->main, 'registerShortcodes']); |
|
| 92 | + add_action('init', [$this->main, 'registerTaxonomy']); |
|
| 93 | + add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
| 94 | + add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
| 95 | + add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
| 96 | + add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
| 97 | + add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
| 98 | + add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
| 99 | + add_action('wp_footer', [$this->public, 'renderSchema']); |
|
| 100 | + add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
| 101 | + add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
| 102 | + add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
| 103 | + add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4); |
|
| 104 | + add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
| 105 | + add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
| 106 | + add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
| 107 | + add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
| 108 | + add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
| 109 | + add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
| 110 | + add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
| 111 | + add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
| 112 | + add_action('init', [$this->router, 'routePublicPostRequest']); |
|
| 113 | + add_action('admin_init', [$this->settings, 'registerSettings']); |
|
| 114 | + add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
| 115 | + add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
| 116 | + add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
| 117 | + add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
| 118 | + add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
| 119 | + add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
| 120 | + add_action('activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2); |
|
| 121 | + add_action('admin_menu', [$this->welcome, 'registerPage']); |
|
| 122 | + } |
|
| 123 | 123 | } |