IsExcludedCustomFields( $meta_key ) ) { return false; } else { return true; } } /** * Get editor link. * * @param stdClass|int $post - The post. * * @return array $editor_link - Name and value link */ protected function GetEditorLink( $post ) { $post_id = is_int( $post ) ? intval( $post ) : $post->ID; return array( 'name' => 'EditorLinkPost', 'value' => get_edit_post_link( $post_id ), ); } /** * Check "Excluded Custom Fields". * Used in the above function. * * @param string $custom - Custom meta key. * * @return boolean is excluded from monitoring true|false */ public function IsExcludedCustomFields( $custom ) { $custom_fields = $this->plugin->settings()->GetExcludedMonitoringCustom(); if ( in_array( $custom, $custom_fields ) ) { return true; } foreach ( $custom_fields as $field ) { if ( false !== strpos( $field, '*' ) ) { // Wildcard str[any_character] when you enter (str*). if ( substr( $field, - 1 ) == '*' ) { $field = rtrim( $field, '*' ); if ( preg_match( "/^$field/", $custom ) ) { return true; } } // Wildcard [any_character]str when you enter (*str). if ( '*' === substr( $field, 0, 1 ) ) { $field = ltrim( $field, '*' ); if ( preg_match( "/$field$/", $custom ) ) { return true; } } } } return false; } }