This file contains 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 Name: CSV URL Processor | |
Plugin URI: https://gist.github.com/mgratch/ec801047eee7ae3bc06d717200c4196a | |
Description: A WP-CLI command to process URLs from a CSV file. | |
Version: 1.0 | |
Author: Marc Gratch | |
Author URI: https://marcgratch.com | |
*/ |
This file contains 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 | |
/** | |
* Disable support for comments and pingbacks in post types | |
*/ | |
function suntraxfl_disable_comments_post_types_support(): void { | |
$post_types = get_post_types(); | |
foreach ( $post_types as $post_type ) { | |
if ( post_type_supports( $post_type, 'comments' ) ) { | |
remove_post_type_support( $post_type, 'comments' ); |
This file contains 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
if (class_exists('WP_CLI')) { class SEO_Update_Command { public function __invoke() { global $wpdb; $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'salary_market_data' AND post_parent != 0"); $progress = \WP_CLI\Utils\make_progress_bar( 'Updating...', count($post_ids)); foreach($post_ids as $post_id) { update_post_meta($post_id, "_yoast_wpseo_meta-robots-noindex", 1); $progress->tick(); } $progress->finish(); WP_CLI::success('Meta values updated successfully.'); }} WP_CLI::add_command('seo_update', 'SEO_Update_Command');} |
This file contains 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
{ | |
"name": "client-plugins-and-theme", | |
"version": "1.0.0", | |
"description": "A Client Project with custom Plugins and theme.", | |
"main": "index.js", | |
"scripts": { | |
"build": "webpack --mode=production", | |
"dev": "webpack --watch", | |
"eslint": "eslint \"src/**/*.{js,jsx}\" --quiet", | |
"eslint:fix": "eslint \"src/**/_.{js,jsx}\" --quiet --fix", |
This file contains 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 | |
/** | |
* Check for existing billing companies when updating my account data. | |
* | |
* @param WP_Error $errors Errors already added. | |
* @param stdClass $user Current User data. | |
*/ | |
function wc_myaccount_validate_billing_company( $errors, $user ) { |
This file contains 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
while read in;do xargs -I {{***}} echo -e "<a target='_blank' href='mailto:{{***}}?subject=WordCamp DFW 2018 Sponsorship Request&body=Hey SPONSOR NAME,%0D%0DINSERT PERSONAL NOT HERE. I am reaching out as lead organizer for WordCamp DFW 2018.%0D%0DWordCamp DFW will again be held in Fort Worth, Texas this year and will be a 2 day event! November 10th and 11th. We expect ~300 attendees. Since 2014 WCDFW has sold out nearly every year and we expect the same this year. Last year we had an overwhelmingly positive response to the state of the art venue and awesome traffic in the lobby central to all conference tracks -- it was perfect for sponsors tables and an awesome \"hallway track\". The website 2018.dfw.wordcamp.org receives ~200-300 unique hits per day leading up to the conference and will continue to get light traffic years following. Especially if we get videos up :)%0D%0DIf there is interest in sponsorship, our call for sponsors has opened up. The breakdown for sponsorship levels is listed here: https://20 |
This file contains 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 | |
/** | |
* Load Elementor template if available. | |
* | |
* @param $template | |
* | |
* @return string | |
*/ | |
function redirect_virtual_templates_to_index( $template ) { |
This file contains 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
declare -A array=([x-large]='h1' [large]='h2' [medium]='h3' [small]='h4' [x-small]='h5' [xx-smal]='h6'); | |
for key in ${!array[@]};do | |
printf "Start [$key] Search\n"; | |
wp search-replace "[$key]" "<${array[$key]} class='headline headline--slab headline-get-page-color'>" --all-tables --precise --recurse-objects --format=count; | |
printf "Start [/$key] Search\n"; | |
wp search-replace "[/$key]" "</${array[$key]}>" --all-tables --precise --recurse-objects --format=count; | |
printf "Next Search\n"; | |
done; |
This file contains 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 current broken live data local and fix it | |
// run locally and enter appropriate ssh information for the live site. | |
// make sure live is running at least wp-cli version X.X | |
rm _live_posts_export.xml; // make sure we are starting clean | |
// pull the live sites posts and export them into a local xml file | |
wp export --post_type=post --with_attachments --stdout --ssh=vagrant@localhost/srv/www/wordpress-default/public_html > _live_posts_export.xml; | |
// delete all the posts off the local site (we could delete only based on guid if necessary?) | |
wp post delete $(wp post list --post_type='post' --post-status=all --format=ids) --force; |
This file contains 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
// delete all the posts | |
wp post delete $(wp post list --format=ids) --yes |
NewerOlder