@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | private function setTemplateRootPath() |
| 44 | 44 | { |
| 45 | - $this->template_root_path = $this->domain->pluginPath() . 'ui/blocks/'; |
|
| 45 | + $this->template_root_path = $this->domain->pluginPath().'ui/blocks/'; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -15,57 +15,57 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | abstract class BlockRenderer implements BlockRendererInterface |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var DomainInterface |
|
| 20 | - */ |
|
| 21 | - protected $domain; |
|
| 18 | + /** |
|
| 19 | + * @var DomainInterface |
|
| 20 | + */ |
|
| 21 | + protected $domain; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - private $template_root_path; |
|
| 23 | + /** |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + private $template_root_path; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * BlockRenderer constructor. |
|
| 31 | - * |
|
| 32 | - * @param DomainInterface $domain |
|
| 33 | - */ |
|
| 34 | - public function __construct(DomainInterface $domain) |
|
| 35 | - { |
|
| 36 | - $this->domain = $domain; |
|
| 37 | - $this->setTemplateRootPath(); |
|
| 38 | - } |
|
| 29 | + /** |
|
| 30 | + * BlockRenderer constructor. |
|
| 31 | + * |
|
| 32 | + * @param DomainInterface $domain |
|
| 33 | + */ |
|
| 34 | + public function __construct(DomainInterface $domain) |
|
| 35 | + { |
|
| 36 | + $this->domain = $domain; |
|
| 37 | + $this->setTemplateRootPath(); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Sets the root path to the main block template. |
|
| 43 | - */ |
|
| 44 | - private function setTemplateRootPath() |
|
| 45 | - { |
|
| 46 | - $this->template_root_path = $this->domain->pluginPath() . 'ui/blocks/'; |
|
| 47 | - } |
|
| 41 | + /** |
|
| 42 | + * Sets the root path to the main block template. |
|
| 43 | + */ |
|
| 44 | + private function setTemplateRootPath() |
|
| 45 | + { |
|
| 46 | + $this->template_root_path = $this->domain->pluginPath() . 'ui/blocks/'; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Exposes the root path for the main block template. |
|
| 52 | - * @return string |
|
| 53 | - */ |
|
| 54 | - public function templateRootPath() |
|
| 55 | - { |
|
| 56 | - return $this->template_root_path; |
|
| 57 | - } |
|
| 50 | + /** |
|
| 51 | + * Exposes the root path for the main block template. |
|
| 52 | + * @return string |
|
| 53 | + */ |
|
| 54 | + public function templateRootPath() |
|
| 55 | + { |
|
| 56 | + return $this->template_root_path; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * converts GraphQL GUID into EE DB ID |
|
| 62 | - * |
|
| 63 | - * @param string $GUID |
|
| 64 | - * @return int |
|
| 65 | - */ |
|
| 66 | - protected function parseGUID($GUID) |
|
| 67 | - { |
|
| 68 | - $parts = Relay::fromGlobalId($GUID); |
|
| 69 | - return ! empty($parts['id']) ? $parts['id'] : 0; |
|
| 70 | - } |
|
| 60 | + /** |
|
| 61 | + * converts GraphQL GUID into EE DB ID |
|
| 62 | + * |
|
| 63 | + * @param string $GUID |
|
| 64 | + * @return int |
|
| 65 | + */ |
|
| 66 | + protected function parseGUID($GUID) |
|
| 67 | + { |
|
| 68 | + $parts = Relay::fromGlobalId($GUID); |
|
| 69 | + return ! empty($parts['id']) ? $parts['id'] : 0; |
|
| 70 | + } |
|
| 71 | 71 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public static function instance() |
| 40 | 40 | { |
| 41 | 41 | // check if class object is instantiated, and instantiated properly |
| 42 | - if (! self::$_instance instanceof EE_Network_Config) { |
|
| 42 | + if ( ! self::$_instance instanceof EE_Network_Config) { |
|
| 43 | 43 | self::$_instance = new self(); |
| 44 | 44 | } |
| 45 | 45 | return self::$_instance; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // need to bust cache for comparing original if this is a multisite install |
| 137 | 137 | if (is_multisite()) { |
| 138 | 138 | global $current_site; |
| 139 | - $cache_key = $current_site->id . ':ee_network_config'; |
|
| 139 | + $cache_key = $current_site->id.':ee_network_config'; |
|
| 140 | 140 | wp_cache_delete($cache_key, 'site-options'); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -13,180 +13,180 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | final class EE_Network_Config |
| 15 | 15 | { |
| 16 | - /** |
|
| 17 | - * @var EE_Network_Config $_instance |
|
| 18 | - */ |
|
| 19 | - private static $_instance; |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * addons can add their specific network_config objects to this property |
|
| 23 | - * |
|
| 24 | - * @var EE_Config_Base[] $addons |
|
| 25 | - */ |
|
| 26 | - public $addons; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * @var EE_Network_Core_Config $core |
|
| 30 | - */ |
|
| 31 | - public $core; |
|
| 32 | - |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @singleton method used to instantiate class object |
|
| 36 | - * @return EE_Network_Config instance |
|
| 37 | - */ |
|
| 38 | - public static function instance() |
|
| 39 | - { |
|
| 40 | - // check if class object is instantiated, and instantiated properly |
|
| 41 | - if (! self::$_instance instanceof EE_Network_Config) { |
|
| 42 | - self::$_instance = new self(); |
|
| 43 | - } |
|
| 44 | - return self::$_instance; |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * class constructor |
|
| 50 | - */ |
|
| 51 | - private function __construct() |
|
| 52 | - { |
|
| 53 | - do_action('AHEE__EE_Network_Config__construct__begin', $this); |
|
| 54 | - // set defaults |
|
| 55 | - $this->core = apply_filters('FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config()); |
|
| 56 | - $this->addons = array(); |
|
| 57 | - |
|
| 58 | - $this->_load_config(); |
|
| 59 | - |
|
| 60 | - // construct__end hook |
|
| 61 | - do_action('AHEE__EE_Network_Config__construct__end', $this); |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * load EE Network Config options |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 70 | - private function _load_config() |
|
| 71 | - { |
|
| 72 | - // load network config start hook |
|
| 73 | - do_action('AHEE__EE_Network_Config___load_config__start', $this); |
|
| 74 | - $config = $this->get_config(); |
|
| 75 | - foreach ($config as $config_prop => $settings) { |
|
| 76 | - if ($config_prop === 'core' && ! $settings instanceof EE_Network_Core_Config) { |
|
| 77 | - $core = new EE_Network_Core_Config(); |
|
| 78 | - foreach ($settings as $prop => $setting) { |
|
| 79 | - if (property_exists($core, $prop)) { |
|
| 80 | - $core->{$prop} = $setting; |
|
| 81 | - } |
|
| 82 | - } |
|
| 83 | - $settings = $core; |
|
| 84 | - add_filter('FHEE__EE_Network_Config___load_config__update_network_config', '__return_true'); |
|
| 85 | - } |
|
| 86 | - if (is_object($settings) && property_exists($this, $config_prop)) { |
|
| 87 | - $this->{$config_prop} = apply_filters( |
|
| 88 | - 'FHEE__EE_Network_Config___load_config__config_settings', |
|
| 89 | - $settings, |
|
| 90 | - $config_prop, |
|
| 91 | - $this |
|
| 92 | - ); |
|
| 93 | - if (method_exists($settings, 'populate')) { |
|
| 94 | - $this->{$config_prop}->populate(); |
|
| 95 | - } |
|
| 96 | - if (method_exists($settings, 'do_hooks')) { |
|
| 97 | - $this->{$config_prop}->do_hooks(); |
|
| 98 | - } |
|
| 99 | - } |
|
| 100 | - } |
|
| 101 | - if (apply_filters('FHEE__EE_Network_Config___load_config__update_network_config', false)) { |
|
| 102 | - $this->update_config(); |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - // load network config end hook |
|
| 106 | - do_action('AHEE__EE_Network_Config___load_config__end', $this); |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * get_config |
|
| 112 | - * |
|
| 113 | - * @return array of network config stuff |
|
| 114 | - */ |
|
| 115 | - public function get_config() |
|
| 116 | - { |
|
| 117 | - // grab network configuration |
|
| 118 | - $CFG = get_site_option('ee_network_config', array()); |
|
| 119 | - $CFG = apply_filters('FHEE__EE_Network_Config__get_config__CFG', $CFG); |
|
| 120 | - return $CFG; |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * update_config |
|
| 126 | - * |
|
| 127 | - * @param bool $add_success |
|
| 128 | - * @param bool $add_error |
|
| 129 | - * @return bool success |
|
| 130 | - */ |
|
| 131 | - public function update_config($add_success = false, $add_error = true) |
|
| 132 | - { |
|
| 133 | - do_action('AHEE__EE_Network_Config__update_config__begin', $this); |
|
| 134 | - |
|
| 135 | - // need to bust cache for comparing original if this is a multisite install |
|
| 136 | - if (is_multisite()) { |
|
| 137 | - global $current_site; |
|
| 138 | - $cache_key = $current_site->id . ':ee_network_config'; |
|
| 139 | - wp_cache_delete($cache_key, 'site-options'); |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - // we have to compare existing saved config with config in memory because if there is no difference that means |
|
| 143 | - // that the method executed fine but there just was no update. WordPress doesn't distinguish between false because |
|
| 144 | - // there were 0 records updated because of no change vs false because some error produced problems with the update. |
|
| 145 | - $original = get_site_option('ee_network_config'); |
|
| 146 | - |
|
| 147 | - if ($original == $this) { |
|
| 148 | - return true; |
|
| 149 | - } |
|
| 150 | - // update |
|
| 151 | - $saved = update_site_option('ee_network_config', $this); |
|
| 152 | - |
|
| 153 | - do_action('AHEE__EE_Network_Config__update_config__end', $this, $saved); |
|
| 154 | - // if config remains the same or was updated successfully |
|
| 155 | - if ($saved) { |
|
| 156 | - if ($add_success) { |
|
| 157 | - $msg = is_multisite() ? esc_html__( |
|
| 158 | - 'The Event Espresso Network Configuration Settings have been successfully updated.', |
|
| 159 | - 'event_espresso' |
|
| 160 | - ) : esc_html__('Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso'); |
|
| 161 | - EE_Error::add_success($msg); |
|
| 162 | - } |
|
| 163 | - return true; |
|
| 164 | - } |
|
| 165 | - if ($add_error) { |
|
| 166 | - $msg = is_multisite() ? esc_html__( |
|
| 167 | - 'The Event Espresso Network Configuration Settings were not updated.', |
|
| 168 | - 'event_espresso' |
|
| 169 | - ) : esc_html__('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso'); |
|
| 170 | - EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 171 | - } |
|
| 172 | - return false; |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - |
|
| 176 | - /** |
|
| 177 | - * __sleep |
|
| 178 | - * |
|
| 179 | - * @return array |
|
| 180 | - */ |
|
| 181 | - public function __sleep() |
|
| 182 | - { |
|
| 183 | - return apply_filters( |
|
| 184 | - 'FHEE__EE_Network_Config__sleep', |
|
| 185 | - array( |
|
| 186 | - 'core', |
|
| 187 | - ) |
|
| 188 | - ); |
|
| 189 | - } |
|
| 16 | + /** |
|
| 17 | + * @var EE_Network_Config $_instance |
|
| 18 | + */ |
|
| 19 | + private static $_instance; |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * addons can add their specific network_config objects to this property |
|
| 23 | + * |
|
| 24 | + * @var EE_Config_Base[] $addons |
|
| 25 | + */ |
|
| 26 | + public $addons; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @var EE_Network_Core_Config $core |
|
| 30 | + */ |
|
| 31 | + public $core; |
|
| 32 | + |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @singleton method used to instantiate class object |
|
| 36 | + * @return EE_Network_Config instance |
|
| 37 | + */ |
|
| 38 | + public static function instance() |
|
| 39 | + { |
|
| 40 | + // check if class object is instantiated, and instantiated properly |
|
| 41 | + if (! self::$_instance instanceof EE_Network_Config) { |
|
| 42 | + self::$_instance = new self(); |
|
| 43 | + } |
|
| 44 | + return self::$_instance; |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * class constructor |
|
| 50 | + */ |
|
| 51 | + private function __construct() |
|
| 52 | + { |
|
| 53 | + do_action('AHEE__EE_Network_Config__construct__begin', $this); |
|
| 54 | + // set defaults |
|
| 55 | + $this->core = apply_filters('FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config()); |
|
| 56 | + $this->addons = array(); |
|
| 57 | + |
|
| 58 | + $this->_load_config(); |
|
| 59 | + |
|
| 60 | + // construct__end hook |
|
| 61 | + do_action('AHEE__EE_Network_Config__construct__end', $this); |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * load EE Network Config options |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | + private function _load_config() |
|
| 71 | + { |
|
| 72 | + // load network config start hook |
|
| 73 | + do_action('AHEE__EE_Network_Config___load_config__start', $this); |
|
| 74 | + $config = $this->get_config(); |
|
| 75 | + foreach ($config as $config_prop => $settings) { |
|
| 76 | + if ($config_prop === 'core' && ! $settings instanceof EE_Network_Core_Config) { |
|
| 77 | + $core = new EE_Network_Core_Config(); |
|
| 78 | + foreach ($settings as $prop => $setting) { |
|
| 79 | + if (property_exists($core, $prop)) { |
|
| 80 | + $core->{$prop} = $setting; |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | + $settings = $core; |
|
| 84 | + add_filter('FHEE__EE_Network_Config___load_config__update_network_config', '__return_true'); |
|
| 85 | + } |
|
| 86 | + if (is_object($settings) && property_exists($this, $config_prop)) { |
|
| 87 | + $this->{$config_prop} = apply_filters( |
|
| 88 | + 'FHEE__EE_Network_Config___load_config__config_settings', |
|
| 89 | + $settings, |
|
| 90 | + $config_prop, |
|
| 91 | + $this |
|
| 92 | + ); |
|
| 93 | + if (method_exists($settings, 'populate')) { |
|
| 94 | + $this->{$config_prop}->populate(); |
|
| 95 | + } |
|
| 96 | + if (method_exists($settings, 'do_hooks')) { |
|
| 97 | + $this->{$config_prop}->do_hooks(); |
|
| 98 | + } |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | + if (apply_filters('FHEE__EE_Network_Config___load_config__update_network_config', false)) { |
|
| 102 | + $this->update_config(); |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + // load network config end hook |
|
| 106 | + do_action('AHEE__EE_Network_Config___load_config__end', $this); |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * get_config |
|
| 112 | + * |
|
| 113 | + * @return array of network config stuff |
|
| 114 | + */ |
|
| 115 | + public function get_config() |
|
| 116 | + { |
|
| 117 | + // grab network configuration |
|
| 118 | + $CFG = get_site_option('ee_network_config', array()); |
|
| 119 | + $CFG = apply_filters('FHEE__EE_Network_Config__get_config__CFG', $CFG); |
|
| 120 | + return $CFG; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * update_config |
|
| 126 | + * |
|
| 127 | + * @param bool $add_success |
|
| 128 | + * @param bool $add_error |
|
| 129 | + * @return bool success |
|
| 130 | + */ |
|
| 131 | + public function update_config($add_success = false, $add_error = true) |
|
| 132 | + { |
|
| 133 | + do_action('AHEE__EE_Network_Config__update_config__begin', $this); |
|
| 134 | + |
|
| 135 | + // need to bust cache for comparing original if this is a multisite install |
|
| 136 | + if (is_multisite()) { |
|
| 137 | + global $current_site; |
|
| 138 | + $cache_key = $current_site->id . ':ee_network_config'; |
|
| 139 | + wp_cache_delete($cache_key, 'site-options'); |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + // we have to compare existing saved config with config in memory because if there is no difference that means |
|
| 143 | + // that the method executed fine but there just was no update. WordPress doesn't distinguish between false because |
|
| 144 | + // there were 0 records updated because of no change vs false because some error produced problems with the update. |
|
| 145 | + $original = get_site_option('ee_network_config'); |
|
| 146 | + |
|
| 147 | + if ($original == $this) { |
|
| 148 | + return true; |
|
| 149 | + } |
|
| 150 | + // update |
|
| 151 | + $saved = update_site_option('ee_network_config', $this); |
|
| 152 | + |
|
| 153 | + do_action('AHEE__EE_Network_Config__update_config__end', $this, $saved); |
|
| 154 | + // if config remains the same or was updated successfully |
|
| 155 | + if ($saved) { |
|
| 156 | + if ($add_success) { |
|
| 157 | + $msg = is_multisite() ? esc_html__( |
|
| 158 | + 'The Event Espresso Network Configuration Settings have been successfully updated.', |
|
| 159 | + 'event_espresso' |
|
| 160 | + ) : esc_html__('Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso'); |
|
| 161 | + EE_Error::add_success($msg); |
|
| 162 | + } |
|
| 163 | + return true; |
|
| 164 | + } |
|
| 165 | + if ($add_error) { |
|
| 166 | + $msg = is_multisite() ? esc_html__( |
|
| 167 | + 'The Event Espresso Network Configuration Settings were not updated.', |
|
| 168 | + 'event_espresso' |
|
| 169 | + ) : esc_html__('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso'); |
|
| 170 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 171 | + } |
|
| 172 | + return false; |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + |
|
| 176 | + /** |
|
| 177 | + * __sleep |
|
| 178 | + * |
|
| 179 | + * @return array |
|
| 180 | + */ |
|
| 181 | + public function __sleep() |
|
| 182 | + { |
|
| 183 | + return apply_filters( |
|
| 184 | + 'FHEE__EE_Network_Config__sleep', |
|
| 185 | + array( |
|
| 186 | + 'core', |
|
| 187 | + ) |
|
| 188 | + ); |
|
| 189 | + } |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
@@ -195,28 +195,28 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | class EE_Network_Core_Config extends EE_Config_Base |
| 197 | 197 | { |
| 198 | - /** |
|
| 199 | - * PUE site license key |
|
| 200 | - * |
|
| 201 | - * @var string $site_license_key |
|
| 202 | - * @deprecated 5.0.20.p |
|
| 203 | - */ |
|
| 204 | - public $site_license_key; |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * This indicates whether messages system processing should be done on the same request or not. |
|
| 208 | - * |
|
| 209 | - * @var boolean $do_messages_on_same_request |
|
| 210 | - */ |
|
| 211 | - public $do_messages_on_same_request; |
|
| 212 | - |
|
| 213 | - |
|
| 214 | - /** |
|
| 215 | - * EE_Network_Core_Config constructor. |
|
| 216 | - */ |
|
| 217 | - public function __construct() |
|
| 218 | - { |
|
| 219 | - $this->site_license_key = ''; |
|
| 220 | - $this->do_messages_on_same_request = false; |
|
| 221 | - } |
|
| 198 | + /** |
|
| 199 | + * PUE site license key |
|
| 200 | + * |
|
| 201 | + * @var string $site_license_key |
|
| 202 | + * @deprecated 5.0.20.p |
|
| 203 | + */ |
|
| 204 | + public $site_license_key; |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * This indicates whether messages system processing should be done on the same request or not. |
|
| 208 | + * |
|
| 209 | + * @var boolean $do_messages_on_same_request |
|
| 210 | + */ |
|
| 211 | + public $do_messages_on_same_request; |
|
| 212 | + |
|
| 213 | + |
|
| 214 | + /** |
|
| 215 | + * EE_Network_Core_Config constructor. |
|
| 216 | + */ |
|
| 217 | + public function __construct() |
|
| 218 | + { |
|
| 219 | + $this->site_license_key = ''; |
|
| 220 | + $this->do_messages_on_same_request = false; |
|
| 221 | + } |
|
| 222 | 222 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class WordPressPageEditorAddNew extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false |
|
| 26 | - && $this->request->getRequestParam('post_type', 'post') === 'page'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false |
|
| 26 | + && $this->request->getRequestParam('post_type', 'post') === 'page'; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class WordPressPostsEditorAddNew extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false |
|
| 26 | - && $this->request->getRequestParam('post_type', 'post') === 'post'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false |
|
| 26 | + && $this->request->getRequestParam('post_type', 'post') === 'post'; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class WordPressPostsListTable extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return strpos($this->request->requestUri(), 'wp-admin/edit.php') !== false |
|
| 26 | - && $this->request->getRequestParam('post_type', 'post') === 'post'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return strpos($this->request->requestUri(), 'wp-admin/edit.php') !== false |
|
| 26 | + && $this->request->getRequestParam('post_type', 'post') === 'post'; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -15,23 +15,23 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class WordPressPageEditorEdit extends RouteMatchSpecification |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * returns true if current request matches specification |
|
| 20 | - * |
|
| 21 | - * @since 4.9.71.p |
|
| 22 | - * @return boolean |
|
| 23 | - */ |
|
| 24 | - public function isMatchingRoute() |
|
| 25 | - { |
|
| 26 | - global $post; |
|
| 27 | - return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false |
|
| 28 | - && ( |
|
| 29 | - $this->request->getRequestParam('post_type', 'post') === 'page' |
|
| 30 | - || ( |
|
| 31 | - $post instanceof WP_Post |
|
| 32 | - && $post->post_type === 'page' |
|
| 33 | - ) |
|
| 34 | - ) |
|
| 35 | - && $this->request->getRequestParam('action') === 'edit'; |
|
| 36 | - } |
|
| 18 | + /** |
|
| 19 | + * returns true if current request matches specification |
|
| 20 | + * |
|
| 21 | + * @since 4.9.71.p |
|
| 22 | + * @return boolean |
|
| 23 | + */ |
|
| 24 | + public function isMatchingRoute() |
|
| 25 | + { |
|
| 26 | + global $post; |
|
| 27 | + return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false |
|
| 28 | + && ( |
|
| 29 | + $this->request->getRequestParam('post_type', 'post') === 'page' |
|
| 30 | + || ( |
|
| 31 | + $post instanceof WP_Post |
|
| 32 | + && $post->post_type === 'page' |
|
| 33 | + ) |
|
| 34 | + ) |
|
| 35 | + && $this->request->getRequestParam('action') === 'edit'; |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class EspressoEventEditorEdit extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return $this->request->getRequestParam('page') === 'espresso_events' |
|
| 26 | - && $this->request->getRequestParam('action') === 'edit'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return $this->request->getRequestParam('page') === 'espresso_events' |
|
| 26 | + && $this->request->getRequestParam('action') === 'edit'; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class EspressoEventEditorAddNew extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return $this->request->getRequestParam('page') === 'espresso_events' |
|
| 26 | - && $this->request->getRequestParam('action') === 'create_new'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return $this->request->getRequestParam('page') === 'espresso_events' |
|
| 26 | + && $this->request->getRequestParam('action') === 'create_new'; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class EspressoVenueEditorEdit extends RouteMatchSpecification |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * returns true if current request matches specification |
|
| 19 | - * |
|
| 20 | - * @since 4.9.71.p |
|
| 21 | - * @return boolean |
|
| 22 | - */ |
|
| 23 | - public function isMatchingRoute() |
|
| 24 | - { |
|
| 25 | - return $this->request->getRequestParam('page') === 'espresso_venues' |
|
| 26 | - && $this->request->getRequestParam('action') === 'edit'; |
|
| 27 | - } |
|
| 17 | + /** |
|
| 18 | + * returns true if current request matches specification |
|
| 19 | + * |
|
| 20 | + * @since 4.9.71.p |
|
| 21 | + * @return boolean |
|
| 22 | + */ |
|
| 23 | + public function isMatchingRoute() |
|
| 24 | + { |
|
| 25 | + return $this->request->getRequestParam('page') === 'espresso_venues' |
|
| 26 | + && $this->request->getRequestParam('action') === 'edit'; |
|
| 27 | + } |
|
| 28 | 28 | } |