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 | |
/** | |
* List of global WP variables. | |
* | |
* @since 0.3.0 | |
* @since 0.11.0 Changed visibility from public to protected. | |
* @since 0.12.0 Renamed from `$globals` to `$wp_globals` to be more descriptive. | |
* @since 0.12.0 Moved from WordPress_Sniffs_Variables_GlobalVariablesSniff to WordPress_Sniff | |
* | |
* @var 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 | |
class FooClass { | |
public static function get_instance() { | |
static $instance; | |
if ( ! $instance ) { | |
$variant = 'A'; |
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 | |
/** | |
* Remove current action or filter from plugin | |
* | |
* @param string $class_name Class name enqueueing the action. | |
* @param null $action_name Action name. | |
*/ | |
function remove_plugin_action( $class_name, $action_name = null ) { | |
global $wp_filter; |
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 | |
/** | |
* Error-handler to be used as a mu-plugin. | |
* | |
* @package kagg/compatibility | |
*/ | |
// phpcs:disable Generic.Commenting.DocComment.MissingShort | |
/** @noinspection PhpIllegalPsrClassPathInspection */ | |
/** @noinspection AutoloadingIssuesInspection */ |
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 | |
/** | |
* wc1c_import_product_xml hook | |
* Prevent processing a product if there is no product in database with same SKU. | |
* If product with the same SKU found in the db, update _wc1c_guid option to allow product update. | |
* | |
* @param array $product | |
* @param bool $is_full | |
* | |
* @return null|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 | |
add_action( | |
'rest_api_init', | |
static function () { | |
$namespace = 'myplugin/v1'; | |
$route = '/file'; | |
$params = [ | |
[ | |
'methods' => 'GET', |
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 | |
/** | |
* Level order traversal of a general tree. | |
* | |
* @link https://www.geeksforgeeks.org/generic-tree-level-order-traversal/ | |
* @package traverse-general-tree | |
*/ | |
/** | |
* Node of an n-ary tree. |
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
name: Deploy to Stage | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
name: Deploy to Stage |
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 | |
/** | |
* Turnstile class file. | |
* | |
* @package wtei-core | |
*/ | |
namespace WTEICore; | |
use JsonException; |
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
public function shutdown_action() { | |
$keys = $this->get_data_keys(); | |
$data = []; | |
foreach ( $keys as $key ) { | |
$this->data[ $key ] = isset( $this->data[ $key ] ) ? $this->data[ $key ] : []; | |
$data[ $key ] = array_replace( $this->data[ $key ], $this->{$key} ); | |
} | |
wp_cache_set( $this->get_cache_key(), $this->maybe_reduce_cache_size( $data ) ); |
NewerOlder