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
| /** | |
| * Disable the emoji's | |
| */ | |
| function disable_emojis() { | |
| remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
| remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
| remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
| remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
| remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
| remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
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 proof of concept. In real life you would split up the various parts and allow for different cell value | |
| * types. Also read Leviscowles1986's comment below: | |
| * https://gist.github.com/thehelvetian/2e94d60b796735b167dfb1c7560049ae#gistcomment-1822986 | |
| * | |
| * @param array $ary_values An array containing the cell values | |
| * @return bool Request status | |
| */ | |
| function addRowToSpreadsheet($ary_values = array()) { |
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 | |
| /** | |
| * | |
| * Infinite Scroll | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @author Lauren Gray | |
| * @author Bill Erickson |
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 | |
| //* Do NOT include the opening php tag | |
| //* Remove content/sidebar layout | |
| genesis_unregister_layout( 'content-sidebar' ); | |
| //* Remove sidebar/content layout | |
| genesis_unregister_layout( 'sidebar-content' ); | |
| //* Remove content/sidebar/sidebar layout |
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
| // Bring back the missing editor for Posts page | |
| add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
| function rgc_posts_page_edit_form( $post ) { | |
| $posts_page = get_option( 'page_for_posts' ); | |
| if ( $posts_page === $post->ID ) { | |
| add_post_type_support( 'page', 'editor' ); | |
| } |
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
| // Bring back the missing editor for Posts page | |
| add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
| function rgc_posts_page_edit_form( $post ) { | |
| $posts_page = get_option( 'page_for_posts' ); | |
| if ( $posts_page === $post->ID ) { | |
| add_post_type_support( 'page', 'editor' ); | |
| } |
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
| //Hi, i created a function for adding variable products based on your code. I share it here in case anyone needs it: | |
| //The first parameter is the title of the product, $cats is the products category id which has to be an array and must be created previously, $variations is an array which contains the variations with prices, descriptions, discount, and $variations_key is the key of the parent attribute which has to be created previously on teh attributes page. | |
| //I´m creating a ticket´s selling store and I´m using 2 globals: $logger and $vgh from my framework, please ignore them. | |
| <? | |
| function create_variable_woo_product($title, $cats = array(), $variations, $variations_key) { | |
| global $wpdb, $logger, $vgh; |
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 // Do not add this line | |
| // Reduce the primary navigation menu to two levels depth. | |
| add_filter( 'wp_nav_menu_args', 'genesis_sample_primary_menu_args' ); | |
| function genesis_sample_primary_menu_args( $args ) { | |
| if ( 'primary' != $args['theme_location'] ) { | |
| return $args; | |
| } |
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
| # Install brew | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # Install composer | |
| brew install homebrew/php/composer | |
| ### PHPCS | |
| composer global require "squizlabs/php_codesniffer=*" | |
| # Add to your .bash_profile |
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 | |
| /** | |
| * Programmatically install and activate wordpress plugins | |
| * | |
| * Usage: | |
| * 1. Edit the $pluginSlugs array at the beginning of this file to include the slugs of all the | |
| * plugins you want to install and activate | |
| * 2. Upload this file to the wordpress root directory (the same directory that contains the | |
| * 'wp-admin' directory). | |
| * 3. Navigate to <your-domain-wordpress-root>/install-wp-plugins.php (If wordpress is installed |