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 | |
// Ajout du menu de selection STYLES | |
// http://codex.wordpress.org/TinyMCE_Custom_Styles | |
function tp_mce_buttons_2( $buttons ) { | |
array_splice( $buttons, 1, 0, 'styleselect' ); | |
return $buttons; | |
} | |
// Register our callback to the appropriate filter | |
add_filter('mce_buttons_2', 'tp_mce_buttons_2'); |
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 | |
/** | |
* Anti Spam Email | |
* [email]contact@thierry-pigot.fr[/email] | |
**/ | |
function tp_antispam_email_shortcode( $atts , $content = null ) | |
{ | |
if ( ! is_email( $content ) ) { | |
return; | |
} |
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 | |
/** | |
* Shortcode Custom post type children as list | |
* Thierry Pigot | |
* 2015-04-07 | |
* | |
* [children id='ID' nb='-1' type='page' depth='1'] | |
**/ | |
function tp_shortcode_children( $atts ) | |
{ |
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 | |
define( 'ACF_LITE' , true ); |
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 | |
add_action( 'after_setup_theme', 'tp_after_setup_theme' ); | |
function tp_after_setup_theme() | |
{ | |
add_editor_style(); | |
} | |
add_filter('mce_buttons_2', 'tp_mce_buttons_2'); | |
function tp_mce_buttons_2($buttons) | |
{ |
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 | |
/** | |
* Change le titre par défaut | |
**/ | |
function tp_custom_title_placeholder( $title ) | |
{ | |
$screen = get_current_screen(); | |
switch( $screen->post_type ) | |
{ | |
case 'FAQ': |
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 | |
/** | |
* remove the ability for users to install or edit themes or plugins, | |
* you can use the following definitions to take care of that. | |
* The first will disable the editors, but still allow installations | |
* and updates of themes/plugins, whereas the second definition will disable all of these functions | |
* | |
**/ | |
define('DISALLOW_FILE_EDIT',true); |
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 | |
/** | |
* Exclude current post/page/cpt from relationship field results | |
*/ | |
add_filter('acf/fields/relationship/query/name=NAME-OF-THE-FIELD', 'bcpj_query_exclude_offre_id', 10, 3); | |
function bcpj_query_exclude_offre_id( $options, $field, $the_post ) | |
{ | |
if( is_admin() ) | |
{ | |
$options['post__not_in'] = array( $the_post->ID ); |
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
RewriteCond %{HTTP_HOST} ^(www\.campus\.ccip\.fr)(:80)? [NC] | |
RewriteRule ^(.*) http://www.campus.cci-paris-idf.fr/$1 [R=301,L] |