1. Enqueue JavaScript and Localize Script In your plugin’s admin script enqueue function, add: php Copy code function enqueue_inline_editing_scripts() { // Enqueue jQuery if not already included wp_enqueue_script(‘jquery’); // Enqueue your custom inline editing script wp_enqueue_script(‘inline-editing-script’, PLUGIN_URL . ‘admin/js/inline-editing.js’, array(‘jquery’), ‘1.0.0’, true); // Localize script to pass AJAX URL and nonce wp_localize_script(‘inline-editing-script’, ‘inlineEditAjax’, array( ‘ajaxurl’… Continue reading Step-by-Step Guide to Implement Inline Editing in WordPress
Category: Reference
EXIM – Email Terminal Commands
Show queue count : exim -bpc stop exim service : service exim stop start exim service : service exim restart clear all email files exim -bp | awk ‘{print $3}’ | xargs exim -Mrm – removing *
Useful Homebrew Apache-PHP Commands
First off… Homebrew and Apache on the Mac OS are SEPARATE from the default Mac OS Apache installation. You can edit files and change configs in terminal until you’re blue in the face, and see no changes. That’s because you’re probably installing or editing one, while checking the version or functionality of the other. Homebrew… Continue reading Useful Homebrew Apache-PHP Commands
GIT add new remote to bitbucket
git remote add origin https://username@bitbucket.org/username/reponame.git git add git commit git push –set-upstream origin master
React Native Simulator – Specify Device
Run these commands inside your React Native project to specify a particular iOS device react-native run-ios –simulator=”iPhone 5s” react-native run-ios –simulator=”iPhone 6″ react-native run-ios –simulator=”iPhone 6 Plus” react-native run-ios –simulator=”iPhone 6s” react-native run-ios –simulator=”iPhone 6s Plus” react-native run-ios –simulator=”iPhone 7″ react-native run-ios –simulator=”iPhone 7 Plus” react-native run-ios –simulator=”iPhone 8″ react-native run-ios –simulator=”iPhone 8 Plus” react-native… Continue reading React Native Simulator – Specify Device
Toggle class in jQuery
jQuery(document).on(‘click’,’.replyPost, .cancelPost’, function(){ jQuery(this).toggleClass(“cancelPost replyPost”); });
Laravel Database Column Types
Command Description $table->bigIncrements(‘id’); Incrementing ID (primary key) using a “UNSIGNED BIG INTEGER” equivalent. $table->bigInteger(‘votes’); BIGINT equivalent for the database. $table->binary(‘data’); BLOB equivalent for the database. $table->boolean(‘confirmed’); BOOLEAN equivalent for the database. $table->char(‘name’, 4); CHAR equivalent with a length. $table->date(‘created_at’); DATE equivalent for the database. $table->dateTime(‘created_at’); DATETIME equivalent for the database. $table->dateTimeTz(‘created_at’); DATETIME (with timezone) equivalent… Continue reading Laravel Database Column Types
Frequently Used Laravel 5.2 Terminal Commands
Here I’m going to keep a list of my own frequently used Laravel 5.2 terminal commands. Every time I need to use one of these commands I end up googling and looking at several different sites to find the right command, and some are outdated. Here’s the list. Use .htaccess to point http server root… Continue reading Frequently Used Laravel 5.2 Terminal Commands
Apache Start – Apache Stop – Apache Restart – Get Apache Version
Start Apache apachectl start Stop Apache apachectl stop Graceful Stop apachectl graceful-stop Restart Apache apachectl restart Graceful restart apachectl graceful To find the Apache version httpd -v
PHP illegal string offset warning
Ran across the PHP Joomla warning after upgrading one of my apps to Joomla 3.45: Warning: Illegal string offset ‘name’ in function golfLeagueShowFormats($formatObject){ $delimiter = “,”; $format_array = explode($delimiter, $formatObject); foreach ($format_array as $format) { $formatnumber = $format[‘name’]; golfLeagueGetFormatName($formatnumber); //return ‘poop’; } } It’s just a warning that only shows up in developer mode. Disabling… Continue reading PHP illegal string offset warning