- Create a folder on your server.
- Copy the composer.json file
- Run
composer install
- Create a file called
restart-php-fpm.php
- Set the correct email, key, server ID and php-fpm version.
- Run
php restart-php-fpm.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 | |
add_action( 'cmb2_admin_init', function() { | |
$prefix = 'mk_add_thickbox_'; | |
$metabox = new_cmb2_box( array( | |
'id' => $prefix.'box', | |
'title' => 'Signature', | |
'object_types' => array( 'post', ), | |
) ); | |
$metabox->add_field( array( |
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: Generate person images | |
*/ | |
use Treinetic\ImageArtist\lib\Text\Color; | |
use Treinetic\ImageArtist\lib\Overlays\Overlay; | |
use Treinetic\ImageArtist\lib\Text\TextBox; | |
use Treinetic\ImageArtist\lib\Text\Font; | |
use Treinetic\ImageArtist\lib\Image; |
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 | |
register_meta('post', 'custom-field', [ | |
'object_subtype' => 'custom-post-type', | |
'show_in_rest' => true | |
]); |
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
var data = new FormData() | |
// Add data/files to formdata var | |
jQuery.ajax({ | |
url: wpApiSettings.root + 'routehere/v1/subroute/save', | |
type: 'POST', | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader( 'X-WP-Nonce', wpApiSettings.nonce ); | |
}, |
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: CMB2 text_datetime_timestamp_timezone Test | |
* Test file for CMB2 Bug Report: https://github.com/CMB2/CMB2/issues/1465 | |
*/ | |
add_action( | |
'cmb2_admin_init', | |
function() { |
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 | |
/** | |
* MK Manage Plugins | |
* Activates and deactivates plugins for a site or network-wide. | |
* - Make sure to define a WORDPRESS_ENV variable in your wp-config.php | |
* Usage Example: | |
* -- | |
* new MK_Manage_Plugins( | |
* array( | |
* 'post-smtp' => array( |
Download WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Test to see if it works correctly
php wp-cli.phar --info
Add extra permissions
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 MK_Woocommerce { | |
public function __construct() { | |
$this->init(); | |
} | |
public function init() { | |
add_filter( 'woocommerce_account_menu_items', array( $this, 'manage_menu_items' ), 80 ); |
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 Plugin { | |
public function __construct() { | |
add_filter( 'acf/settings/save_json', array( $this, 'acf_location' ) ); | |
add_filter( 'acf/settings/load_json', array( $this, 'acf_locations' ) ); | |
} | |
public function acf_location() { | |
return plugin_dir_path( __FILE__ ) . 'acf-json/'; |
NewerOlder