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_filter('manage_pages_columns', 'add_page_template_column'); | |
| function add_page_template_column($columns) { | |
| $columns['page_template'] = 'Page Template'; // Add a new column with the header "Page Template" | |
| return $columns; | |
| } | |
| add_action('manage_pages_custom_column', 'display_page_template_in_column', 10, 2); | |
| function display_page_template_in_column($column_name, $post_id) { | |
| if ($column_name == 'page_template') { | |
| $template_file = get_page_template_slug($post_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 | |
| /** | |
| * Google Chrome Coverage Export Parser PHP | |
| * | |
| * Export a coverage report from Google Chrome: | |
| * Developer Tools > 3-dot menu > More tools > Coverage | |
| * | |
| * Download the coverage report JSON file by clicking the "Export..." icon on | |
| * the Coverage panel toolbar | |
| * |
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 | |
| /** | |
| * Create a VCard For Brokers (this was first built for Mericle) | |
| * Return the last segment of the URI | |
| * | |
| * | |
| * This feature works by creating/modifying a vcf file when a broker post type is saved. the template then points to that saved file. | |
| * File will not create if you don't Save/Update the post type. | |
| * |
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
| USER=$GIT_AUTH_USER | |
| PASS=$GIT_AUTH_TOKEN | |
| if git rev-parse --git-dir > /dev/null 2>&1; then : | |
| # This is a valid git repository (but the current working | |
| # directory may not be the top level. | |
| # Check the output of the git rev-parse command if you care) | |
| REPO=`git remote show github | grep "Fetch URL:" | sed "s#^.*/\(.*\).git#\1#"` | |
| echo $REPO | |
| OWNER=`git remote show github | grep "Fetch URL:" | cut -d "@" -f2 | cut -d ":" -f2 | cut -d "/" -f1` |
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 | |
| // include this file in your root index.php before any Wordpress files start getting pulled in. | |
| // allow us to force garbage collection (for performance) | |
| // commented out for now because it should be enabled by default. Going to test without it first. | |
| // gc_enable(); // PHP >= 5.3.0 | |
| // old_path => new_path | |
| // make sure all of your old_paths have no trailing slash |
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 | |
| /** | |
| * Page Rewrite Priority | |
| * | |
| * @link https://wordpress.stackexchange.com/questions/22438/how-to-make-pages-slug-have-priority-over-any-other-taxonomies-like-custom-post | |
| */ | |
| function carbon_rewrite_init() { | |
| $GLOBALS['wp_rewrite']->use_verbose_page_rules = true; | |
| } | |
| add_action( 'init', 'carbon_rewrite_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 | |
| add_action( 'init', function () { | |
| if ( $_SERVER['HTTP_HOST'] === 'example.com.local' ) { | |
| /** Add User */ | |
| $username = 'username'; | |
| $password = 'password'; | |
| $email = 'email@example.com'; |
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
| function basename( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /.*\//, '' ); | |
| } | |
| function dirname( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /\/[^\/]*$/, '' ); | |
| } | |
| console.log( dirname( '/srv/www/dev/umid/admin/cfg.admin.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
| function carbon_tag_cloud_class_active($tags_data) { | |
| $body_class = get_body_class(); | |
| foreach ($tags_data as $key => $tag) { | |
| if(in_array('tag-'.$tag['id'], $body_class)) { | |
| $tags_data[$key]['class'] = $tags_data[$key]['class'] ." active-tag"; | |
| } | |
| } |
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('acf/render_field_settings/type=number', 'add_readonly_and_disabled_to_number_field'); | |
| function add_readonly_and_disabled_to_text_field($field) { | |
| acf_render_field_setting( $field, array( | |
| 'label' => __('Read Only?','acf'), | |
| 'instructions' => '', | |
| 'type' => 'radio', | |
| 'name' => 'readonly', | |
| 'choices' => array( |
NewerOlder