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 Preview { | |
| /** | |
| * Register WordPress hooks and filters | |
| * | |
| * @return void | |
| */ | |
| public function register() { |
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
| export const ltrim = (str, char) => { | |
| let message = str; | |
| if (typeof message !== 'undefined') { | |
| while (message[0] === char) { | |
| message = message.substring(1); | |
| } | |
| } | |
| return message; | |
| }; |
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 | |
| /** | |
| * Helper function to insert node after another node. | |
| * | |
| * @param DOMNode $newNode Node to be appended. | |
| * @param DOMNode $refNode Node required to have new node appended after it. | |
| */ | |
| function insertAfter ( $newNode, $refNode ) { | |
| if( $refNode->nextSibling ){ | |
| $refNode->parentNode->insertBefore( $newNode, $refNode->nextSibling ); |
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
| cd ios | |
| pod cache clean --all | |
| rm -rf "${HOME}/Library/Caches/CocoaPods" | |
| rm -rf "`pwd`/Pods/" | |
| pod update |
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
| /** | |
| * Start point for CLI command to process some posts in batches | |
| * | |
| * ## EXAMPLES | |
| * | |
| * wp mycommand | |
| * | |
| * @subcommand process-posts | |
| * | |
| * @param array $args Positional arguments for the command. |
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
| /** | |
| * Determine if it's a REST API request. | |
| * | |
| * @return boolean True if rest request. | |
| */ | |
| function is_rest() { | |
| return defined( 'REST_REQUEST' ) && REST_REQUEST; | |
| } | |
| /** |
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 headers api for for POST from localhost:3000: | |
| <?php | |
| // init hook as will be global. send_headers hook doesn't work on rest api. | |
| add_action( 'init', [ $this, 'security_headers' ] ); | |
| // DEBUG_MODE_CLIENT_URL = http://localhost:3000 | |
| public function security_headers() { | |
| if ( defined( 'DEBUG_MODE_CLIENT_URL' ) ) { | |
| header("Access-Control-Allow-Origin: " . DEBUG_MODE_CLIENT_URL); |
OlderNewer