Skip to content

Instantly share code, notes, and snippets.

View Mahjouba91's full-sized avatar
🏠
Working from home

Florian TIAR Mahjouba91

🏠
Working from home
  • London / Paris
View GitHub Profile
@Mahjouba91
Mahjouba91 / tinymce_custom_styles.php
Last active October 21, 2016 08:14
Custom tinyMCE Style
<?php
add_filter( 'tiny_mce_before_init', 'add_frame_style' );
/*
* Add the new tinyMCE style
*/
public static function add_frame_style( $params ) {
$style_formats = json_decode( $params['style_formats'] );
$style_formats[] = array(
'title' => 'Notes',
'block' => 'div',
# Pour l'archive diff
git archive -o diff.zip Num_Ver $(git diff --name-only --diff-filter=ACMRT Num_Ver_Old)
# Pour la liste des fichiers supprimés
git diff --name-status --diff-filter=D Num_Ver_Old Num_Ver -- > file-deleted.txt
@Mahjouba91
Mahjouba91 / filter_admin_column_by_taxonomy.php
Last active October 21, 2016 08:22
Filter admin column in list view with a custom taxonomy
<?php
add_action( 'restrict_manage_posts' , 'filter_taxonomy_columns' );
/**
* Allow admin to filter CPT by custom taxonomies in CPT list view
*
* @author Florian Tiar
*/
function filter_taxonomy_columns( $post_type ) {
if ( 'my_cpt' !== $post_type ) {
@Mahjouba91
Mahjouba91 / index.php
Last active December 22, 2015 10:28
Wordpress Admin Filter : Filter top level pages
<?php
//defining the filter that will be used to select pages by 'top level pages'
add_action('restrict_manage_posts','add_post_formats_filter_to_post_administration');
function add_post_formats_filter_to_post_administration(){
//execute only on the 'post' content type
global $post_type;
if( $post_type == 'page' ){
$pages_arg = array(