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
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
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
<?php | |
/* | |
* Dans cet exemple mon Custom Post Type est "revendeurs" | |
*/ | |
add_filter('posts_join', 'revendeurs_search_join' ); | |
function revendeurs_search_join ($join){ | |
global $pagenow, $wpdb; | |
// I want the filter only when performing a search on edit page of Custom Post Type named "revendeurs" | |
if ( is_admin() && $pagenow=='edit.php' && $_GET['post_type']=='revendeurs' && $_GET['s'] != '') |
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
<?php | |
add_action( 'init', 'register_my_taxo' ); | |
function register_my_taxo() { | |
register_taxonomy( 'immo_cat', 'immobilier', array( | |
'hierarchical' => false, | |
'label' => 'Type de biens', | |
// je déclare le slug de taxo de manière à pouvoir le traduire | |
'rewrite' => array( 'slug' => icl_t('nebula', 'property-type-slug', 'type-bien-immobilier' ) ), | |
) ); | |
} |
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
<?php | |
add_filter( 'nav_menu_css_class', 'je_portfolio_menu_item_classes', 10, 2 ); | |
/** | |
* Add css classes to Portfolio CPT menu item, remove from Blog item | |
* | |
* Enables menu classes for CPTs. | |
* Pretty fragile, as it depends on the item titles for each menu item, change as required | |
* | |
* @param array $classes CSS classes for the menu item |