';
$header = $this->get_metabox_header( $tabs );
echo $header;
$active = '';
foreach ( $tabs as $m ) {
echo '
';
if ( ! $active ) {
$active = ' style="display:none;"';
}
$m['args'] = $m['callback_args'];
$m['callback'][0]->{$m['callback'][1]}( $post, $m );
echo '
';
}
echo '
';
}
/**
* Get Metabox Header
*
* @since ?
*
* @param $tabs
*
* @return string
*/
function get_metabox_header( $tabs ) {
$header = '';
return $header;
}
/**
* Admin Bar Menu
*
* @since ?
*/
function admin_bar_menu() {
if ( apply_filters( 'aioseo_show_in_admin_bar', true ) === false ) {
// API filter hook to disable showing SEO in admin bar.
return;
}
global $wp_admin_bar, $aioseop_admin_menu, $post, $aioseop_options;
$toggle = '';
if ( isset( $_POST['aiosp_use_original_title'] ) && isset( $_POST['aiosp_admin_bar'] ) && AIOSEOPPRO ) {
$toggle = 'on';
}
if ( isset( $_POST['aiosp_use_original_title'] ) && ! isset( $_POST['aiosp_admin_bar'] ) && AIOSEOPPRO ) {
$toggle = 'off';
}
if ( ( ! isset( $aioseop_options['aiosp_admin_bar'] ) && 'off' !== $toggle ) || ( ! empty( $aioseop_options['aiosp_admin_bar'] ) && 'off' !== $toggle ) || isset( $_POST['aiosp_admin_bar'] ) || true == apply_filters( 'aioseo_show_in_admin_bar', false ) ) {
if ( apply_filters( 'aioseo_show_in_admin_bar', true ) === false ) {
// API filter hook to disable showing SEO in admin bar.
return;
}
$menu_slug = plugin_basename( __FILE__ );
$url = '';
if ( function_exists( 'menu_page_url' ) ) {
$url = menu_page_url( $menu_slug, 0 );
}
if ( empty( $url ) ) {
$url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
}
$wp_admin_bar->add_menu(
array(
'id' => AIOSEOP_PLUGIN_DIRNAME,
'title' => __( 'SEO', 'all-in-one-seo-pack' ),
'href' => $url,
)
);
if ( current_user_can( 'update_plugins' ) && ! AIOSEOPPRO ) {
$wp_admin_bar->add_menu(
array(
'parent' => AIOSEOP_PLUGIN_DIRNAME,
/* translators: This is a CTA action link to upgrade to the premium version of the plugin. */
'title' => __( 'Upgrade To Pro', 'all-in-one-seo-pack' ),
'id' => 'aioseop-pro-upgrade',
'href' => 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=menu',
'meta' => array( 'target' => '_blank' ),
)
);
// phpcs:ignore Squiz.Commenting.InlineComment.InvalidEndChar
// add_action( 'admin_bar_menu', array( $this, 'admin_bar_upgrade_menu' ), 1101 );
}
$aioseop_admin_menu = 1;
if ( ! is_admin() && ! empty( $post ) ) {
$blog_page = aiosp_common::get_blog_page( $post );
if ( ! empty( $blog_page ) ) {
$post = $blog_page;
}
// Don't show if we're on the home page and the home page is the latest posts.
if ( ! is_home() || ( ! is_front_page() && ! is_home() ) ) {
global $wp_the_query;
$current_object = $wp_the_query->get_queried_object();
if ( is_singular() ) {
if ( ! empty( $current_object ) && ! empty( $current_object->post_type ) ) {
// Try the main query.
$edit_post_link = get_edit_post_link( $current_object->ID );
$wp_admin_bar->add_menu(
array(
'id' => 'aiosp_edit_' . $current_object->ID,
'parent' => AIOSEOP_PLUGIN_DIRNAME,
'title' => 'Edit SEO',
'href' => $edit_post_link . '#aiosp',
)
);
} else {
// Try the post object.
$wp_admin_bar->add_menu(
array(
'id' => 'aiosp_edit_' . $post->ID,
'parent' => AIOSEOP_PLUGIN_DIRNAME,
'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
'href' => get_edit_post_link( $post->ID ) . '#aiosp',
)
);
}
}
if ( AIOSEOPPRO && ( is_category() || is_tax() || is_tag() ) ) {
// SEO for taxonomies are only available in Pro version.
$edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy );
$wp_admin_bar->add_menu(
array(
'id' => 'aiosp_edit_' . $post->ID,
'parent' => AIOSEOP_PLUGIN_DIRNAME,
'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
'href' => $edit_term_link . '#aiosp',
)
);
}
}
}
}
}
/**
* Menu Order
*
* @since ?
*
* Order for adding the menus for the aioseop_modules_add_menus hook.
*/
function menu_order() {
return 5;
}
/**
* Display Category Metaboxes
*
* @since ?
*
* @param $tax
*/
function display_category_metaboxes( $tax ) {
$screen = 'edit-' . $tax->taxonomy;
?>