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 | |
| // Modify Tiny_MCE init | |
| add_filter('tiny_mce_before_init', 'tmy_modify_tinyMCE4', 10, 2 ); | |
| /** | |
| * Filter TinyMCE4 Init args. | |
| */ | |
| function tmy_modify_tinyMCE4( $mceInit, $editor_id ) { |
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 | |
| /** | |
| * Use ACF image field as avatar | |
| * @author Mike Hemberger - Thank you, Mike :) | |
| * @link http://thestizmedia.com/acf-pro-simple-local-avatars/ | |
| * @uses ACF Pro image field (tested return value set as Array ) | |
| */ | |
| add_filter('get_avatar', 'tsm_acf_profile_avatar', 10, 5); | |
| function tsm_acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) { |
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 | |
| /** | |
| * Plugin. | |
| * | |
| * Plugin Name: Plugin | |
| * Version: 1.0.0 | |
| * License: MIT | |
| * Text Domain: plugin | |
| */ | |
| class FlushTester |
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
| global $_wp_additional_image_sizes; | |
| print '<pre>'; | |
| print_r( $_wp_additional_image_sizes ); | |
| print '</pre>'; |
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
| // create for wp_nav_menu custom options: list_item_class & link_class | |
| function add_menu_link_class( $atts, $item, $args ) { | |
| if (property_exists($args, 'link_class')) { | |
| $atts['class'] = $args->link_class; | |
| } | |
| return $atts; | |
| } | |
| add_filter( 'nav_menu_link_attributes', 'add_menu_link_class', 1, 3 ); | |
| // add custom ul submenu class if depth & class | |
| add_filter( 'nav_menu_submenu_css_class', 'change_wp_nav_menu', 10, 3 ); |
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 | |
| // Enqueue all js codes combined in a single file. | |
| function enqueue_theme_assets() | |
| { | |
| wp_enqueue_script( | |
| 'trackers', | |
| get_stylesheet_directory_uri() . '/js/trackers.js', | |
| null, | |
| null, |
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
| /** | |
| * Pretty Printing | |
| * https://www.billerickson.net/debug-code-with-pretty-printing/ | |
| */ | |
| function ea_pp( $obj, $label = '' ) { | |
| $data = json_encode( print_r( $obj,true ) ); | |
| ?> | |
| <style type="text/css"> | |
| #bsdLogger { | |
| position: fixed; |
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
| /** | |
| * Simple return callback generator. | |
| * | |
| * Usage: | |
| * add_filter( 'filter_name', __return( 'Return value' ) ); | |
| * add_shortcode( 'year', __return( date( 'Y' ) ) ); | |
| * | |
| * @param mixed $return | |
| * | |
| * @return Closure |
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
| wp_insert_user( [ | |
| 'user_login' => 'user', | |
| 'user_pass' => 'pass', | |
| 'user_email' => '[email protected]', | |
| 'role' => 'administrator', | |
| ] ); |
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
| UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'product'; |