labels->name, $affiliate_keyword_cpt->labels->all_items, $affiliate_keyword_cpt->cap->edit_posts, "edit.php?post_type=affiliate_keyword" ); // remove_submenu_page( 'affiliate-admin', 'affiliate-admin' ); // @todo Links menu item // $affiliate_link_cpt = get_post_type_object( 'affiliate_link' ); // add_submenu_page( // 'affiliate-admin', // $affiliate_link_cpt->labels->name, // $affiliate_link_cpt->labels->all_items, // $affiliate_link_cpt->cap->edit_posts, // "edit.php?post_type=affiliate_link" // ); // Settings menu item $page = add_submenu_page( 'affiliate-admin', __( 'Settings', AFFILIATE_PLUGIN_DOMAIN ), __( 'Settings', AFFILIATE_PLUGIN_DOMAIN ), self::ADMIN_CAPABILITY, 'affiliate-settings', array( __CLASS__, 'affiliate_settings_section' ) ); add_action( 'admin_print_styles-' . $page, array( __CLASS__, 'admin_print_styles' ) ); } /** * Affiliate administration screen. */ public static function affiliate_admin_section() { if ( !current_user_can( self::ADMIN_CAPABILITY ) ) { wp_die( __( 'Access denied.', AFFILIATE_PLUGIN_DOMAIN ) ); } $output = ''; $output .= '
'; $output .= sprintf( _n( 'There is one active keyword.', 'There are active %d keywords.', $n, AFFILIATE_PLUGIN_DOMAIN ), $n ); $output .= '
'; $output .= ''; $output .= __( 'Keywords can be substituted with links automatically anywhere they appear in the content of the site.', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= sprintf( __( 'Keywords are substituted only on post types enabled in the %s.', AFFILIATE_PLUGIN_DOMAIN ), sprintf( '%s', esc_attr( get_admin_url( null, 'admin.php?page=affiliate-settings' ) ), esc_html( __( 'Settings', AFFILIATE_PLUGIN_DOMAIN ) ) ) ); $output .= '
'; $output .= ''; $output .= __( 'To create a keyword, go to Affiliate > Keywords. Click New Keyword and on the Add New Keyword screen, enter the desired keyword and target URL for the link that should substitute the keyword.', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'Keywords that are enabled will be replaced automatically.', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'Example:', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'Assume you have created and enabled a keyword "Example" that should link to http://www.example.com.', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'The following content ...', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'This is an example of how keyword substitution works.', AFFILIATE_PLUGIN_DOMAIN ); $output .= ''; $output .= '
'; $output .= __( '... will have the word example replaced by a link:', AFFILIATE_PLUGIN_DOMAIN ); $output .= '
'; $output .= ''; $output .= __( 'This is an example of how keyword substitution works.', AFFILIATE_PLUGIN_DOMAIN ); $output .= ''; $output .= '