Skip to content

Commit

Permalink
Module info: refactor Module info, remove unused filter.
Browse files Browse the repository at this point in the history
There was a time when disconnected users could find out more about a specific module before to connect Jetpack to WordPress.com.
Now that the UI has changed, the modules don't display any modal until you're connected. The jetpack_module_more_info_connected_<module-slug> hooks are consequently not userful anymore.
  • Loading branch information
jeherve committed Jan 4, 2016
1 parent 6474a65 commit 644fa6a
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 409 deletions.
24 changes: 7 additions & 17 deletions class.jetpack-admin.php
Expand Up @@ -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.
Expand Down
9 changes: 2 additions & 7 deletions class.jetpack-modules-list-table.php
Expand Up @@ -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 '<div id="more-info-' . $item['module'] . '" class="more-info">';
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 '</div>';
return ob_get_clean();
}
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit 644fa6a

Please sign in to comment.