challenge
1 year ago
css
1 month ago
img
1 year ago
js
1 month ago
menu
1 month ago
partials
3 days ago
rest-api
3 days ago
scss
1 year ago
settings
1 month ago
uninstall
1 year ago
wpchill
1 month ago
admin-notices.php
5 months ago
admin.php
1 month ago
class-strong-testimonials-addons.php
1 month ago
class-strong-testimonials-admin-category-list.php
1 year ago
class-strong-testimonials-admin-list.php
1 year ago
class-strong-testimonials-admin-scripts.php
1 month ago
class-strong-testimonials-admin.php
1 month ago
class-strong-testimonials-debug.php
5 months ago
class-strong-testimonials-exporter.php
1 year ago
class-strong-testimonials-help.php
1 year ago
class-strong-testimonials-helper.php
1 month ago
class-strong-testimonials-list-table.php
1 year ago
class-strong-testimonials-lite-vs-pro-page.php
1 month ago
class-strong-testimonials-post-editor.php
6 months ago
class-strong-testimonials-review.php
1 year ago
class-strong-testimonials-updater.php
1 month ago
class-strong-testimonials-upsell.php
1 month ago
class-strong-views-list-table.php
1 month ago
class-walker-strong-category-checklist.php
1 year ago
class-walker-strong-form-category-checklist.php
1 year ago
class-wpmtst-onboarding.php
1 year ago
compat.php
1 year ago
custom-fields-ajax.php
1 year ago
custom-fields.php
3 days ago
form-preview.php
1 year ago
view-list-order.php
1 year ago
views-ajax.php
1 month ago
views-validate.php
1 year ago
views.php
1 month ago
compat.php
116 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Prevent other post ordering plugins, in admin_menu hook. |
| 5 | * |
| 6 | * @since 1.16.0 |
| 7 | */ |
| 8 | function wpmtst_deny_plugins_menu() { |
| 9 | |
| 10 | /** |
| 11 | * Post Types Order |
| 12 | */ |
| 13 | if ( is_plugin_active( 'post-types-order/post-types-order.php' ) ) { |
| 14 | remove_submenu_page( 'edit.php?post_type=wpm-testimonial', 'order-post-types-wpm-testimonial' ); |
| 15 | } |
| 16 | } |
| 17 | add_action( 'admin_menu', 'wpmtst_deny_plugins_menu', 200 ); |
| 18 | |
| 19 | |
| 20 | /** |
| 21 | * Plugin and theme compatibility in admin. |
| 22 | * |
| 23 | * @since 2.4.0 |
| 24 | */ |
| 25 | function wpmtst_compat_admin_init() { |
| 26 | $theme = wp_get_theme(); |
| 27 | |
| 28 | /* ------------------------------------------------------------ |
| 29 | * Theme Name: Mercury |
| 30 | * Theme URI: http://themes.themegoods2.com/mercury |
| 31 | * Description: Premium Template for Photography Portfolio |
| 32 | * Version: 1.7.5 |
| 33 | * Author: Peerapong Pulpipatnan |
| 34 | * Author URI: http://themeforest.net/user/peerapong |
| 35 | * ------------------------------------------------------------ |
| 36 | * Mercury enqueues its scripts and styles poorly. |
| 37 | * 1. on the `admin_init` hook |
| 38 | * 2. UNconditionally |
| 39 | */ |
| 40 | if ( 'Mercury' === $theme->get( 'Name' ) && 'http://themes.themegoods2.com/mercury' === $theme->get( 'ThemeURI' ) ) { |
| 41 | |
| 42 | /** Screen information is not available yet. */ |
| 43 | //$screen = get_current_screen(); |
| 44 | //if ( $screen && 'wpm-testimonial' == $screen->post_type ) { |
| 45 | |
| 46 | if ( false !== strpos( $_SERVER['QUERY_STRING'], 'post_type=wpm-testimonial' ) ) { |
| 47 | if ( function_exists( 'pp_add_init' ) ) { |
| 48 | remove_action( 'admin_init', 'pp_add_init' ); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | add_action( 'admin_init', 'wpmtst_compat_admin_init', 1 ); |
| 54 | |
| 55 | |
| 56 | /** |
| 57 | * Prevent other post ordering plugins, in admin_init hook. |
| 58 | * |
| 59 | * @since 1.16.0 |
| 60 | */ |
| 61 | function wpmtst_deny_plugins_init() { |
| 62 | |
| 63 | /** |
| 64 | * Intuitive Custom Post Order |
| 65 | */ |
| 66 | if ( is_plugin_active( 'intuitive-custom-post-order/intuitive-custom-post-order.php' ) ) { |
| 67 | $options = get_option( 'hicpo_options' ); |
| 68 | $update = false; |
| 69 | |
| 70 | if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) { |
| 71 | if ( in_array( 'wpm-testimonial', $options['objects'], true ) ) { |
| 72 | $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) ); |
| 73 | $update = true; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) { |
| 78 | if ( in_array( 'wpm-testimonial-category', $options['tags'], true ) ) { |
| 79 | $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) ); |
| 80 | $update = true; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | if ( $update ) { |
| 85 | update_option( 'hicpo_options', $options, 'no' ); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Simple Custom Post Order |
| 91 | */ |
| 92 | if ( is_plugin_active( 'simple-custom-post-order/simple-custom-post-order.php' ) ) { |
| 93 | $options = get_option( 'scporder_options' ); |
| 94 | $update = false; |
| 95 | |
| 96 | if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) { |
| 97 | if ( in_array( 'wpm-testimonial', $options['objects'], true ) ) { |
| 98 | $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) ); |
| 99 | $update = true; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) { |
| 104 | if ( in_array( 'wpm-testimonial-category', $options['tags'], true ) ) { |
| 105 | $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) ); |
| 106 | $update = true; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | if ( $update ) { |
| 111 | update_option( 'scporder_options', $options, 'no' ); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | add_action( 'admin_init', 'wpmtst_deny_plugins_init', 200 ); |
| 116 |