Skip to content

Commit

Permalink
Merge pull request #39 from WordImpress/release/1.7
Browse files Browse the repository at this point in the history
Merge updates
  • Loading branch information
ramiy committed Oct 8, 2016
2 parents e5055ae + 34d27b8 commit 9087ad1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
6 changes: 2 additions & 4 deletions includes/admin/EDD_SL_Plugin_Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,18 @@ public function init() {
*
* @uses api_request()
*
* @global $pagenow
*
* @param array $_transient_data Update array build by WordPress.
* @return array Modified update array with custom plugin data.
*/
function check_update( $_transient_data ) {

global $pagenow;
$screen = get_current_screen();

if( ! is_object( $_transient_data ) ) {
$_transient_data = new stdClass;
}

if( 'plugins.php' == $pagenow && is_multisite() ) {
if( 'plugins.php' == $screen->parent_file && is_multisite() ) {
return $_transient_data;
}

Expand Down
31 changes: 21 additions & 10 deletions includes/post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,27 @@ function give_register_post_type_statuses() {
function give_updated_messages( $messages ) {
global $post, $post_ID;

$url1 = '<a href="' . get_permalink( $post_ID ) . '">';
$url2 = '</a>';

$messages['give_forms'] = array(
1 => sprintf( __( 'Form updated. %1$sView Form%2$s.', 'give' ), $url1, $url2 ),
4 => sprintf( __( 'Form updated. %1$sView Form%2$s.', 'give' ), $url1, $url2 ),
6 => sprintf( __( 'Form published. %1$sView Form%2$s.', 'give' ), $url1, $url2 ),
7 => sprintf( __( 'Form saved. %1$sView Form%2$s.', 'give' ), $url1, $url2 ),
8 => sprintf( __( 'Form submitted. %1$sView Form%2$s.', 'give' ), $url1, $url2 )
);
if ( give_get_option( 'disable_forms_singular' ) === 'on' ) {

$messages['give_forms'] = array(
1 => esc_html__( 'Form updated.', 'give' ),
4 => esc_html__( 'Form updated.', 'give' ),
6 => esc_html__( 'Form published.', 'give' ),
7 => esc_html__( 'Form saved.', 'give' ),
8 => esc_html__( 'Form submitted.', 'give' )
);

} else {

$messages['give_forms'] = array(
1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html__( 'Form updated.', 'give' ), get_permalink( $post_ID ), esc_html__( 'View Form', 'give' ) ),
4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html__( 'Form updated.', 'give' ), get_permalink( $post_ID ), esc_html__( 'View Form', 'give' ) ),
6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html__( 'Form published.', 'give' ), get_permalink( $post_ID ), esc_html__( 'View Form', 'give' ) ),
7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html__( 'Form saved.', 'give' ), get_permalink( $post_ID ), esc_html__( 'View Form', 'give' ) ),
8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html__( 'Form submitted.', 'give' ), get_permalink( $post_ID ), esc_html__( 'View Form', 'give' ) )
);

}

return $messages;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit-tests/tests-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ public function test_register_styles() {
public function test_load_admin_scripts_bail() {

// Prepare test
global $pagenow;
$origin_pagenow = $pagenow;
$pagenow = 'dashboard';
$screen = get_current_screen();
$origin_screen = $screen->id;
$current_screen = 'dashboard';

require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';

// Assert
$this->assertNull( give_load_admin_scripts( 'dashboard' ) );

// Reset to origin
$pagenow = $origin_pagenow;
$current_screen = $origin_screen;

}

Expand Down

0 comments on commit 9087ad1

Please sign in to comment.