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 | |
# Installation: | |
## Download the script to your home directory | |
# Make sure it has execute permissions (`chmod +x wp-install-core-sub-dir.sh`). | |
# Install the script in one of the folders in your PATH. (`mv wp-install-core-sub-dir.sh /usr/local/bin/wp-install-core-sub-dir`) | |
#Usage: |
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 | |
add_filter('acf/settings/l10n', '__return_true' ); | |
add_filter('acf/settings/l10n_textdomain', function( $textdomain ) { | |
return 'my-text-domain'; | |
} ); |
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 my_filter_acf_pro_license_option( $pre ) { | |
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) { | |
return $pre; | |
} | |
$data = array( | |
'key' => ACF_PRO_LICENSE, | |
'url' => home_url(), |
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 | |
/** | |
* Generated by the WordPress Option Page generator | |
* at http://jeremyhixon.com/wp-tools/option-page/ | |
*/ | |
class MyExamplePlugin { | |
private $my_example_plugin_options; |
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 | |
namespace DeliciousBrains\Admin; | |
use DeliciousBrains\DBI; | |
class ACF { | |
public function init() { | |
add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) ); |
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 | |
// Add new Discount setting the to discount add and edit forms | |
add_action( 'edd_add_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_add_form' ) ); | |
add_action( 'edd_edit_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_edit_form' ) ); | |
// Handle saving the settings on form submission | |
add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' ); | |
add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' ); |
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 | |
add_filter( 'ninja_forms_create_post_meta_value', 'my_ninja_forms_create_post_meta_value', 10, 3 ); | |
function my_ninja_forms_create_post_meta_value( $value, $post_type, $key ) { | |
if ( 'gallery' !== $key ) { // change this string to match your ACF field name | |
return $value; | |
} | |
return explode( ',', $value ); | |
} |
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/sh | |
if [ "$#" -ne 1 ] | |
then | |
echo "Usage: Must supply a domain" | |
exit 1 | |
fi | |
DOMAIN=$1 |
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
# replace 'file' with the array key you want to extract | |
SELECT | |
SUBSTRING_INDEX( | |
SUBSTRING_INDEX( | |
SUBSTRING(pm.meta_value, ( INSTR( pm.meta_value, CONCAT( 'file', '";' ) ) + CHAR_LENGTH( 'file') + 1 ) ), | |
'"', 2 ), | |
'"', -1 ) as attachment_file | |
FROM wp_posts p | |
INNER JOIN wp_postmeta pm | |
ON p.ID = pm.post_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 | |
// Add this file to the wp-content/mu-plugins/ directory. | |
// It may need to be created if it doesn't exist | |
/** | |
* These constants must be set in wp-config.php | |
* | |
* define('WP_DEBUG', true); | |
* define('WP_DEBUG_LOG', true); |
NewerOlder