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 | |
/* | |
export.php - a script for outputting post type, title and URL in CSV format. | |
All commas are also stripped from titles in order to keep the CSV format (for HootSuite import) versus keeping the titles as is. | |
*/ | |
include "wp-load.php"; | |
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish'); |
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
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
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
#!/usr/bin/python | |
# Print the active OSX app whenever it changes. | |
# (Use to figure out which ill-behaved app is stealing focus away from you.) | |
# Adapted from http://apple.stackexchange.com/a/148094/112614 | |
try: | |
from AppKit import NSWorkspace | |
except ImportError: | |
print "Can't import AppKit -- maybe you're running python from brew?" | |
print "Try running with Apple's /usr/bin/python instead." |
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 | |
/* | |
* Remove the annoying Yoast SEO nag for all Admin Users. Tested with v3.4.2 | |
*/ | |
class ahRemoveYoastNag_Remove_Yoast_SEO_Nag { | |
private $yoastPluginFile; | |
public function __construct() { | |
$this->yoastPluginFile = "wordpress-seo/wp-seo.php"; | |
register_activation_hook( $this->yoastPluginFile, array( $this, 'ryn_remove_yoast_nag_on_activation' ) ); |
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
# export notes from the Bear db to markdown files | |
import sqlite3 | |
BEAR_DB = '/Users/<your username>/Library/Containers/net.shinyfrog.bear/Data/Library/Application Support/net.shinyfrog.bear/database.sqlite' | |
EXPORT_DIR = '<set an export directory>' | |
conn = sqlite3.connect(BEAR_DB) | |
c = conn.cursor() | |
for row in c.execute('SELECT ZTITLE, ZTEXT FROM ZSFNOTE'): |
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 | |
// Sets Beaver Builder as the default editor. | |
function make_beaver_builder_default( $post_ID, $post, $update ) { | |
if ( ! $update ) { | |
update_post_meta( $post_ID, '_fl_builder_enabled', true ); | |
} | |
} | |
add_action( 'wp_insert_post', 'make_beaver_builder_default', 10, 3 ); |
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 // do not include this opening php tag in your file | |
add_filter( 'plugin_action_links_nelio-content/nelio-content.php', 'nc_settings_link' ); | |
function nc_settings_link( $links ) { | |
// Build and escape the URL. | |
$url = esc_url( add_query_arg( | |
'page', | |
'nelio-content-settings', | |
get_admin_url() . 'admin.php' | |
) ); |
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 | |
function create_ACF_meta_in_REST() { | |
$postypes_to_exclude = ['acf-field-group','acf-field']; | |
$extra_postypes_to_include = ["page"]; | |
$post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exclude); | |
array_push($post_types, $extra_postypes_to_include); | |
foreach ($post_types as $post_type) { | |
register_rest_field( $post_type, 'ACF', [ |