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 | |
register_meta('post', 'custom-field', [ | |
'object_subtype' => 'custom-post-type', | |
'show_in_rest' => true | |
]); |
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 | |
class Enable_Software_Updates_For_Free_Downloads { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
add_filter( 'edd_sl_generate_license_key', array( $this, 'generate_free_license_key' ), 10, 5 ); | |
add_filter( 'edd_sl_check_license_status', array( $this, 'skip_free_download_license_check' ), 10, 2 ); |
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 | |
$auth = base64_encode("_user_:_pass_"); | |
$context = stream_context_create([ | |
"http" => [ | |
"header" => "Authorization: Basic $auth" | |
] | |
]); | |
$result = file_get_contents('_url_', false, $context); | |
file_put_contents('_file_.pdf', $result); |
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
Show hidden characters
{ | |
"presets": [ | |
"@babel/preset-env" | |
] | |
} |
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
wp site list --field=url | xargs -n1 -I % wp --url=% cron event run --due-now |
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
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { | |
@media (min-width: 900px) { @content; } | |
} | |
@mixin for-desktop-up { |
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 | |
class Sample { | |
public function register_invoice_endpoint() { | |
register_rest_route( 'prefix/v1/endoint', '/invoice/(?P<id>\d+)', array( | |
'methods' => 'GET', | |
'callback' => array( $this, 'get_invoice' ), | |
'permission_callback' => array( $this, 'get_items_permissions_check' ) | |
) ); | |
} |
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 | |
/** | |
* Plugin Name: Sympose: Overwrite Image Sizes | |
*/ | |
add_action('init', function() { | |
add_image_size( 'person-medium', 150, 150, true ); | |
}, 20); |
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 | |
class Sample { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
// Remove the existing block register function | |
remove_action( 'init', 'register_block_core_latest_posts', 10 ); |