postSettings->canAddPostSettingsMetabox( get_post_type( $this->getPostId() ) ) ) { return; } add_action( 'tcb_main_frame_enqueue', [ $this, 'enqueue' ] ); add_filter( 'tve_main_js_dependencies', [ $this, 'mainJsDependencies' ] ); add_action( 'tcb_right_sidebar_content_settings', [ $this, 'addSettingsTab' ] ); add_action( 'tcb_sidebar_extra_links', [ $this, 'addSidebarButton' ] ); add_filter( 'tcb_main_frame_localize', [ $this, 'localizeData' ] ); } /** * Overrides the parent enqueue to add WordPress styles that we need. * * @since 4.6.6 * * @return void */ public function enqueue() { wp_enqueue_style( 'common' ); wp_enqueue_style( 'buttons' ); wp_enqueue_style( 'forms' ); wp_enqueue_style( 'list-tables' ); wp_enqueue_style( 'wp-components' ); print_admin_styles(); parent::enqueue(); } /** * Add our javascript to the plugin dependencies. * * @since 4.6.6 * * @param array $dependencies The dependencies. * @return array The dependencies. */ public function mainJsDependencies( $dependencies ) { $dependencies[] = aioseo()->core->assets->jsHandle( "src/vue/standalone/page-builders/{$this->integrationSlug}/main.js" ); return $dependencies; } /** * Add the extra link to the sidebar. * * @since 4.6.6 * * @return void */ public function addSidebarButton() { $tooltip = sprintf( // Translators: 1 - The plugin short name ("AIOSEO"). esc_html__( '%1$s Settings', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ); // phpcs:disable Generic.Files.LineLength.MaxExceeded ?>
editor_enabled(); } /** * Returns whether should or not limit the modified date. * * @since 4.6.6 * * @param int $postId The Post ID. * @return boolean Whether or not sholud limit the modified date. */ public function limitModifiedDate( $postId ) { if ( ! class_exists( 'TCB_Editor_Ajax' ) ) { return false; } // This method is supposed to be used in the `wp_ajax_tcb_editor_ajax` action. if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), \TCB_Editor_Ajax::NONCE_KEY ) ) { return false; } $editorPostId = ! empty( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; if ( $editorPostId !== $postId ) { return false; } return ! empty( $_REQUEST['aioseo_limit_modified_date'] ) && 'true' === $_REQUEST['aioseo_limit_modified_date']; } }