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
#!/bin/bash | |
# Note the fifference between Install and Update | |
# Install : if the language doesn't exist, this is the first step to get the last asked language package. It is also needed, in order to update. | |
# Update : will get the last asked translation package, only if the language is already installed. | |
# Install core in french if not existing | |
wp language core install fr_FR | |
# Update all existing core languages |
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 class Favicons { | |
/** | |
* The path suffix for the icons | |
* | |
* @var string | |
*/ | |
private $path_suffix = '/html/src/assets/img/favicons/'; | |
public function _init() { |
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 class MC_Customize_WP_Mail { | |
private $sender_mail; | |
private $sender_name; | |
private $reply_mail; | |
private $replay_name; | |
/** | |
* Set custom sender mail and name for all sent emails | |
* and add a reply to mail and name to allow people replying to your sent emails |
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
#!/bin/bash | |
# 1. Generate a bunch of dummy images, for that I use http://unsample.net | |
# 2. Upload it via sftp or whatever | |
# 3. Import the images into the WordPress library using the uploaded path | |
wp media import media-to-import/* | |
# 3.1 It will import the images by generating the following prompt : |
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 | |
/** | |
* This is a basic exemple on how to load assets depending on the version of the theme | |
* On a fresh delevery, it allows to refresh the assets on client sides | |
* It could have been implementeed as a class (todo) | |
* @author Maxime CULEA | |
*/ | |
add_action( 'wp', 'mc_register_assets' ); | |
function mc_register_assets() { |
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( 'enqueue_block_editor_assets', 'disable_editor_fullscreen' ); | |
function disable_editor_fullscreen() { | |
if ( ! is_admin() ) { | |
return; | |
} | |
wp_add_inline_script( 'wp-blocks', "jQuery( window ).load(function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } });" ); | |
} |
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 | |
/** | |
* Allow to download a lang despite DISALLOW_FILE_MODS to true | |
* @author Maxime Culea | |
*/ | |
add_filter( 'file_mod_allowed', function ( $value, $context ) { | |
if ( $context == 'can_install_language_pack' ) { | |
return 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
<?php class MC_Template_Part_Var { | |
/** | |
* @author Maxime Culea | |
* @var MC_Template_Part_Var | |
*/ | |
public static $instance; | |
/** | |
* Vars to store | |
* |