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 | |
| if (isset($argv[1])) $title = $argv[1]; else { print "Usage php wpinsert TITLE POSTTYPE \n -- POSTTYPE is optional and defaults to page\n"; exit; } | |
| if (isset($argv[2])) $type = $argv[2]; else { print "Post type defaulting to PAGE\n"; $type="page"; } | |
| //required include files | |
| define('WP_DEBUG', false); | |
| require('wp-blog-header.php'); | |
| require_once("wp-config.php"); | |
| require_once("wp-includes/wp-db.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
| ini_set("log_errors", 1); | |
| ini_set("error_log", "php-error.log"); | |
| error_log( "Hello, errors!" ); |
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
| foreach ($d = array('<br>', self::USER, self::ENDPOINT, $query_string) as $e) {echo $e . $d[0];} |
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
| dscacheutil -flushcache;sudo killall -HUP mDNSResponder |
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
| /* http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields | |
| */ | |
| add_filter('gform_pre_render_5', 'populate_posts'); | |
| function populate_posts($form){ | |
| foreach($form['fields'] as &$field){ | |
| if( strpos($field['cssClass'], 'multi-selector') === false) /* original had a check for $field['type'] != 'select' */ | |
| continue; | |
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('wp_footer', 'add_char_counter'); | |
| function add_char_counter() { | |
| if ( is_page( array( 'add-a-highlight', 'add-a-publication' ) ) ) { ?> | |
| <script src="/wp-content/themes/ameriflux/library/js/textcounter.min.js"></script> | |
| <script type="text/javascript"> | |
| jQuery('.amx-title input').textcounter({ | |
| max: 250, | |
| countDownText: "Characters Left: " | |
| }); |
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
| define('WP_DEBUG', true); | |
| define('WP_DEBUG_LOG', true); | |
| define('WP_DEBUG_DISPLAY', false); |
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
| // this goes in the page template or where you need it | |
| // make sure that your add_action and your callback are in functions, not in a page template | |
| wp_enqueue_script('karla'); | |
| $ajax_nonce = wp_create_nonce( "karla-nonce" ); | |
| wp_localize_script('karla','getter',array('ajax_url' => admin_url( 'admin-ajax.php' ),'sugar'=>$_GET['sugar']), 'security'=> $ajax_nonce ); | |
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 ($) { | |
| $.each(['show', 'hide'], function (i, ev) { | |
| var el = $.fn[ev]; | |
| $.fn[ev] = function () { | |
| this.trigger(ev); | |
| return el.apply(this, arguments); | |
| }; | |
| }); | |
| })(jQuery); |
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
| if (isset($_GET['debug']) ) { | |
| define('WP_DEBUG',true); | |
| if ( $_GET['debug']=='log') { | |
| // Enable Debug logging to the /wp-content/debug.log file | |
| // The web user will have to have write permission to the file | |
| /* uncomment next to use wordpress file default of wp-content/debug.log, make sure of write permission */ | |
| //define('WP_DEBUG_LOG', true); | |
| /* or use a file in the wp-content/uploads directory, which should always have write perms on it */ | |
| @ini_set('error_log', dirname(__FILE__) . '/wp-content/uploads/debug.log'); | |
| // Disable display of errors and warnings |