diff --git a/class.jetpack-admin.php b/class.jetpack-admin.php index 7420297bb209c..6e46ee3867291 100644 --- a/class.jetpack-admin.php +++ b/class.jetpack-admin.php @@ -111,23 +111,13 @@ function get_modules() { $module_array['learn_more_button'] = ob_get_clean(); ob_start(); - if ( Jetpack::is_active() && has_action( 'jetpack_module_more_info_connected_' . $module ) ) { - /** - * Allow the display of information text when Jetpack is connected to WordPress.com. - * The dynamic part of the action, $module, is the module slug. - * - * @since 3.0.0 - */ - do_action( 'jetpack_module_more_info_connected_' . $module ); - } else { - /** - * Allow the display of information text when Jetpack is connected to WordPress.com. - * The dynamic part of the action, $module, is the module slug. - * - * @since 3.0.0 - */ - do_action( 'jetpack_module_more_info_' . $module ); - } + /** + * Allow the display of information text when Jetpack is connected to WordPress.com. + * The dynamic part of the action, $module, is the module slug. + * + * @since 3.0.0 + */ + do_action( 'jetpack_module_more_info_' . $module ); /** * Filter the long description of a module. diff --git a/class.jetpack-modules-list-table.php b/class.jetpack-modules-list-table.php index c7e18f9da031b..941bae754e68b 100644 --- a/class.jetpack-modules-list-table.php +++ b/class.jetpack-modules-list-table.php @@ -306,13 +306,8 @@ function column_description( $item ) { /** This action is documented in class.jetpack-admin.php */ do_action( 'jetpack_learn_more_button_' . $item['module'] ); echo '
'; - if ( Jetpack::is_active() && has_action( 'jetpack_module_more_info_connected_' . $item['module'] ) ) { - /** This action is documented in class.jetpack-admin.php */ - do_action( 'jetpack_module_more_info_connected_' . $item['module'] ); - } else { - /** This action is documented in class.jetpack-admin.php */ - do_action( 'jetpack_module_more_info_' . $item['module'] ); - } + /** This action is documented in class.jetpack-admin.php */ + do_action( 'jetpack_module_more_info_' . $item['module'] ); echo '
'; return ob_get_clean(); } diff --git a/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php b/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php index c714ec9acf674..79b637b3bff31 100644 --- a/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php +++ b/json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php @@ -93,13 +93,8 @@ protected static function format_module( $module_slug ) { // Fetch the HTML formatted long description ob_start(); - if ( Jetpack::is_active() && has_action( 'jetpack_module_more_info_connected_' . $module_slug ) ) { - /** This action is documented in class.jetpack-modules-list-table.php */ - do_action( 'jetpack_module_more_info_connected_' . $module_slug ); - } else { - /** This action is documented in class.jetpack-modules-list-table.php */ - do_action( 'jetpack_module_more_info_' . $module_slug ); - } + /** This action is documented in class.jetpack-modules-list-table.php */ + do_action( 'jetpack_module_more_info_' . $module_slug ); $module['description'] = ob_get_clean(); return $module; diff --git a/modules/module-info.php b/modules/module-info.php index 05901b0829124..ed597a4666ea1 100644 --- a/modules/module-info.php +++ b/modules/module-info.php @@ -2,12 +2,26 @@ /** * "Learn More" information blocks for all modules live in this file. * - * jetpack_module_more_info_ hooks are for pre-connection information - * jetpack_module_more_info_connected_ hooks are used once the user - * is connected to show them links to admin panels, usage info etc. + * Each module must include 2 functions: + * - The first one creates a button where users can find more information about the module. + * It is hooked into `jetpack_learn_more_button_ . $module` + * - The second creates a information block. + * It is hooked into `jetpack_module_more_info_ . $module` */ -// VaultPress (stub) +/** + * VaultPress (stub) + */ +function vaultpress_jetpack_load_more_link() { + if ( function_exists( 'is_multisite' ) && is_multisite() ) { + $vaultpress_url = 'http://vaultpress.com/jetpack-ms/'; + } else { + $vaultpress_url = 'http://vaultpress.com/jetpack/'; + } + + echo '' . __( "Learn More", 'jetpack' ) . ''; +} +add_filter( 'jetpack_learn_more_button_vaultpress', 'vaultpress_jetpack_load_more_link' ); function vaultpress_jetpack_more_info() { if ( function_exists( 'is_multisite' ) && is_multisite() ) { @@ -32,20 +46,15 @@ function vaultpress_jetpack_more_info() { ' . __( "Learn More", 'jetpack' ) . ''; +/** + * Gravatar Hovercards + */ +function grofiles_load_more_link() { + echo '' . esc_html__( 'Learn More', 'jetpack' ) . ''; } -add_filter( 'jetpack_learn_more_button_vaultpress', 'vaultpress_jetpack_load_more_link' ); +add_filter( 'jetpack_learn_more_button_gravatar-hovercards', 'grofiles_load_more_link' ); -// Gravatar Hovercards function grofiles_more_info() { ?> -
-

-

- - -

' . esc_html__( 'Learn More', 'jetpack' ) . ''; +/** + * Shortcodes + */ +function jetpack_shortcodes_load_more_link( $description ) { + echo '' . esc_html__( 'Learn More' , 'jetpack' ) . ''; } -add_filter( 'jetpack_learn_more_button_gravatar-hovercards', 'grofiles_load_more_link' ); - +add_filter( 'jetpack_learn_more_button_shortcodes', 'jetpack_shortcodes_load_more_link' ); -// Shortcodes function jetpack_shortcodes_more_info() { ?> -

- - -

'flickr' => 'http://support.wordpress.com/videos/flickr-video/', 'gist' => 'http://en.support.wordpress.com/gist/', 'googlemaps' => 'http://support.wordpress.com/google-maps/', - 'instagram' => 'https://en.support.wordpress.com/instagram/instagram-images/', + 'instagram' => 'https://en.support.wordpress.com/instagram/instagram-images/', 'jetpack_subscription_form' => 'http://jetpack.me/support/subscriptions/#display', 'polldaddy' => 'http://support.polldaddy.com/wordpress-shortcodes/', 'presentation' => 'http://en.support.wordpress.com/presentations/', @@ -139,15 +123,16 @@ function jetpack_shortcodes_more_info_connected() { ?>

' . esc_html__( 'Learn More' , 'jetpack' ) . ''; +/** + * Shortlinks + */ +function wpme_load_more_link( $description ) { + echo '' . esc_html__( 'Learn More', 'jetpack' ) . ''; } -add_filter( 'jetpack_learn_more_button_shortcodes', 'jetpack_shortcodes_load_more_link' ); - +add_filter( 'jetpack_learn_more_button_shortlinks', 'wpme_load_more_link' ); -// Shortlinks function wpme_more_info() { ?>