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 | |
| /** | |
| * On-the-fly CSS Compression | |
| * Copyright (c) 2009 and onwards, Manas Tungare. | |
| * Creative Commons Attribution, Share-Alike. | |
| * | |
| * In order to minimize the number and size of HTTP requests for CSS content, | |
| * this script combines multiple CSS files into a single file and compresses | |
| * it on-the-fly. | |
| * |
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 | |
| /** | |
| * | |
| * cURL and XML parsing. | |
| * | |
| */ | |
| $url = "http://www.w3schools.com/xml/simple.xml"; | |
| $ch = curl_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
| curl -O https://wordpress.org/latest.zip | |
| unzip latest.zip | |
| mv wordpress site | |
| rm latest.zip |
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 | |
| $args = array( | |
| 'role' => 'Administrator', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => 'first_name', | |
| 'value' => '', | |
| 'compare' => '!=' | |
| ), | |
| ), |
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
| /** | |
| * Turn links in a WordPress menu into icons linked to social profiles | |
| * | |
| * This file implements the social menu icons technique by Justin Tadlock for | |
| * the Socicon font, which supports a very large number of social network sites. | |
| * | |
| * Learn how to set up a social menu from Justin here: | |
| * | |
| * http://justintadlock.com/archives/2013/08/07/social-media-nav-menus | |
| * |
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
| wget64 http://wordpress.org/latest.tar.gz | |
| 7z e latest.tar.gz & 7z x latest.tar | |
| robocopy wordpress ./ /MOVE /E | |
| del latest.tar | |
| del latest.tar.gz | |
| ren wp-config-sample.php wp-config.php |
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 Clean_Walker_Nav extends Walker_Nav_Menu { | |
| /** | |
| * Filter used to remove built in WordPress-generated classes | |
| * @param mixed $var The array item to verify | |
| * @return boolean Whether or not the item matches the filter | |
| */ | |
| function filter_builtin_classes( $var ) { | |
| return ( FALSE === strpos( $var, 'item' ) ) ? $var : ''; | |
| } |
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
| // add new field under gallery post format forms ui | |
| add_action( 'vp_pfui_after_gallery_meta', 'mytheme_add_gallery_type_field' ); | |
| // handle the saving of our new field | |
| add_action( 'admin_init' , 'mytheme_admin_init' ); | |
| function mytheme_admin_init() { | |
| $post_formats = get_theme_support('post-formats'); | |
| if (!empty($post_formats[0]) && is_array($post_formats[0])) { | |
| if (in_array('gallery', $post_formats[0])) { |
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 a query var to sniff requests | |
| add_filter( 'query_vars', 'my_query_var_callback', 10, 1 ); | |
| function my_query_var_callback( $vars ){ | |
| $vars[] = 'dynamic_js'; | |
| return $vars; | |
| } | |
| #Dynamic JavaScript | |
| add_rewrite_rule( '^assets/js/dynamic\.js$', 'index.php?dynamic_js=1', 'top' ); //Note the hidden query variable |
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 Redux Framework with Timber | |
| * | |
| * Use this class like you would Redux Framework. All options are automatically | |
| * made available in your Timber template context (by default as 'options'). | |
| * | |
| * Extra optional arguments in the $args array: | |
| * - 'timber_context' (string) Name of the variable in template context. |