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 | |
$tables = array(); | |
$m = TablePress::load_model( 'table' ); | |
$ids = $m->load_all( true, false ); | |
foreach ($ids as $id) { | |
$table = $m->load( $id ); | |
$tables[$table['id']] = $table['name']; | |
} |
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
/* | |
* Based on http://torquemag.io/automating-wordpress-plugin-updates-releases-grunt/ | |
* | |
* added: | |
* copy:svn_assets task | |
* makepot, creates read-offline.pot | |
*/ | |
module.exports = function (grunt) { |
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 | |
/** | |
* Use Gravatar as your site icon, add the code to your (child) theme functions.php or use it in a plugin | |
* Requires: WordPress 4.3 | |
* | |
* @param array $meta_tags default site icon meta tags array | |
* @return array return the modified site icon meta tags array | |
*/ | |
function gravatar_site_icon ($meta_tags) { |
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
add_action( 'admin_menu', function() { | |
if (! current_user_can('administrator')) { | |
remove_menu_page('edit.php?post_type=acf'); | |
} | |
}); |
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 | |
// you need to add the post content to $post_content | |
preg_match_all('/src=([\'"])?((?(1).*?|\S+))(?(1)\1)/', $post_content, $images); | |
if (count($images[2]) > 0) { | |
foreach ($images[2] as $src) { | |
$image_id = pn_get_attachment_id_from_url($src); | |
/* | |
Do something with the $image_id |
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 | |
//code from https://wordpress.org/plugins/cloudflare/ | |
/** | |
* remove http and https from links, save in mu-plugins | |
*/ | |
if (true !== function_exists('cloudflare_buffer_wrapup')) { | |
function cloudflare_buffer_wrapup($buffer) { | |
// Check for a Content-Type header. Currently only apply rewriting to "text/html" or undefined |
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
# #!/bin/bash | |
# # | |
# # provision-post.sh (save the file in VVV/provision) | |
# # | |
# # Adding Gearman to VVV | |
# # | |
# # This file is specified in Vagrantfile and is loaded by Vagrant _after_ the primary | |
# # provisioning script whenever the commands `vagrant up`, `vagrant provision`, | |
# # or `vagrant reload` are used. |
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: WP CLI GEARS | |
Version: 0.0.2 | |
Description: Testing WP CLI and WP Gears | |
Author: Per Soderlind | |
Author URI: https://soderlind.no | |
Plugin URI: https://gist.github.com/soderlind/a27527c3ed6545f594d7 | |
License: GPL | |
*/ |
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 load_divi_fix() { | |
global $wp_scripts; | |
wp_enqueue_script( 'jquery-ui-core' ); | |
// get registered script object for jquery-ui | |
$ui = $wp_scripts->query( 'jquery-ui-core' ); | |
// dequeue old style and scripts loaded by the Divi theme | |
wp_dequeue_style( 'et_pb_admin_date_css' ); |
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 | |
class First_Page_Image { | |
private static $instance; | |
private static $post_ID = 0; | |
public static function instance() { | |
if ( self::$instance ) { | |
return self::$instance; | |
} |
OlderNewer