codepress / column-shortcodes

Column Shortcodes for WordPress
https://wordpress.org/plugins/column-shortcodes/
15 stars 17 forks source link

Media button not working in ACF options pages #9

Closed ghost closed 10 years ago

ghost commented 10 years ago

Could do with adding admin.php to is is_edit_screen() function so that the media button displays in the ACF generated options pages.

private function is_edit_screen() { global $pagenow; if ( in_array( $pagenow, array( 'post-new.php', 'page-new.php', 'post.php', 'page.php', 'profile.php', 'user-edit.php', 'user-new.php', 'admin.php' ) ) ) return true;

return false;

}

tobiasschutter commented 10 years ago

I have added a filter for this, so it's more flexible for additional pages. apply_filters( 'cpsh_allowed_screens', ... ).

// Example Usage
function cpsh_screens( $screens ) {
$screens[] = 'admin.php';
return $screens;
}
add_filter( 'cpsh_allowed_screens', 'screens' ).