values
13 years ago
license.php
13 years ago
sortable.php
13 years ago
utility.php
13 years ago
values.php
13 years ago
utility.php
57 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Fix for getting the columns loaded by WordPress SEO Yoast |
| 5 | * |
| 6 | * The added columns from WordPress SEO by Yoast weren't available on |
| 7 | * the admin columns settings page. The reason was that class-metabox.php was prevented |
| 8 | * from loading. This fix will also load this class when admin columns is loaded. |
| 9 | * |
| 10 | * @since 1.4.6 |
| 11 | */ |
| 12 | function pre_load_wordpress_seo_class_metabox() |
| 13 | { |
| 14 | global $pagenow; |
| 15 | |
| 16 | if ( |
| 17 | isset( $_REQUEST['page'] ) && |
| 18 | 'codepress-admin-columns' == $_REQUEST['page'] && |
| 19 | 'options-general.php' == $pagenow && |
| 20 | defined('WPSEO_PATH') && file_exists(WPSEO_PATH.'admin/class-metabox.php') |
| 21 | ) { |
| 22 | require_once WPSEO_PATH.'admin/class-metabox.php'; |
| 23 | } |
| 24 | } |
| 25 | add_action( 'plugins_loaded', 'pre_load_wordpress_seo_class_metabox', 0 ); |
| 26 | |
| 27 | /** |
| 28 | * Fix which remove the Advanced Custom Fields Type (acf) from the admin columns settings page |
| 29 | * |
| 30 | * @since 1.5 |
| 31 | */ |
| 32 | function remove_acf_from_cpac_post_types( $post_types ) |
| 33 | { |
| 34 | if ( class_exists('Acf') ) { |
| 35 | unset( $post_types['acf'] ); |
| 36 | } |
| 37 | |
| 38 | return $post_types; |
| 39 | } |
| 40 | add_filter( 'cpac-get-post-types', 'remove_acf_from_cpac_post_types' ); |
| 41 | |
| 42 | /** |
| 43 | * Fix which removes bbPress Posttypes ( forum, reply and topic ) from the admin columns settings page |
| 44 | * |
| 45 | * @since 1.5 |
| 46 | */ |
| 47 | function remove_bbpress_from_cpac_post_types( $post_types ) |
| 48 | { |
| 49 | if ( class_exists('bbPress') ) { |
| 50 | unset( $post_types['topic'] ); |
| 51 | unset( $post_types['reply'] ); |
| 52 | unset( $post_types['forum'] ); |
| 53 | } |
| 54 | |
| 55 | return $post_types; |
| 56 | } |
| 57 | add_filter( 'cpac-get-post-types', 'remove_bbpress_from_cpac_post_types' ); |