This file contains hidden or 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
app.select2 = { | |
init: function( el ) { | |
if ( 'undefined' === typeof el ) { | |
return; | |
} | |
var scope = this, | |
args = { | |
maximumSelectionLength: 1, | |
templateSelection: function( item ) { |
This file contains hidden or 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
muplugins_loaded | |
registered_taxonomy | |
registered_taxonomy | |
registered_taxonomy | |
registered_taxonomy | |
registered_taxonomy | |
registered_post_type | |
registered_post_type | |
registered_post_type | |
registered_post_type |
This file contains hidden or 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
$category_arr = array(); | |
$current_category = get_the_category(); | |
foreach ( $current_category as $cat ) { | |
$category_arr[] = $cat->term_id; | |
} | |
$args = array( | |
'post_type' => 'cpt_name', | |
'post_status' => 'publish', |
This file contains hidden or 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
// MY_USER_ID | |
define( 'MY_USER_ID', 7 ); | |
/** | |
* Delete User action, checks for our defined user id | |
* | |
*/ | |
function themename_delete_user( $id ){ | |
if ( $id == MY_USER_ID ) { | |
wp_die( 'You cannot delete this user' ); |
This file contains hidden or 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
$form = get_field( 'gravity_form' ); | |
if ( $form ) { | |
echo do_shortcode( '[gravityforms id="' . $form->id . '" title="false" description="false" ajax="true"]' ); | |
} |
This file contains hidden or 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
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'nopaging' => true, // remove if pagination is required | |
'no_found_rows' => true, // remove if pagination is required | |
'update_post_term_cache' => false, | |
'update_post_meta_cache' => false, | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) : |
This file contains hidden or 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
add_filter( 'pre_get_posts', function( $query ){ | |
if ( isset( $_GET['s'] ) && empty( $_GET['s'] ) && $query->is_main_query() ) { | |
$query->is_search = true; | |
$query->is_home = false; | |
} | |
return $query; | |
}); |
This file contains hidden or 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
/** | |
* Post types slugs | |
* | |
*/ | |
add_filter( 'pll_translated_post_type_rewrite_slugs', function( $post_type_translated_slugs ) | |
{ | |
$post_type_translated_slugs = array( | |
// cpt_name | |
'cpt_name' => array( |