Created
December 28, 2019 10:40
-
-
Save 2ndkauboy/fe42bb2815499a8ad38a3b5403ecd57a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Unique Title Checker Across Post Types | |
* | |
* @package unique-title-checker-across-post-types | |
* @author Bernhard Kau | |
* @license GPLv3 | |
* | |
* @wordpress-plugin | |
* Plugin Name: Unique Title Checker Across Post Types | |
* Plugin URI: https://gist.github.com/2ndkauboy/fe42bb2815499a8ad38a3b5403ecd57a | |
* Description: Changes the query for the "Unique Title Checker" plugin to check for duplicate title in any post type | |
* Version: 1.0.0 | |
* Author: Bernhard Kau | |
* Author URI: http://kau-boys.de | |
* Text Domain: unique-title-checker-across-post-types | |
* License: GPLv3 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0 | |
*/ | |
/** | |
* Remove the filter on the post type so the uniqueness is checked against all post types. | |
* | |
* @param array $args The WP_Query arguments for the uniqueness query. | |
* | |
* @return array | |
*/ | |
function unique_title_checker_across_post_types_arguments( $args ) { | |
unset( $args['post_type'] ); | |
return $args; | |
} | |
add_filter( 'unique_title_checker_arguments', 'unique_title_checker_across_post_types_arguments' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment