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
// for windows | |
vendor\bin\phpunit tests/ExampleTest.php | |
// for Mac |
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
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); |
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
function removeBomUtf8($s){ | |
if(substr($s,0,3)==chr(hexdec('EF')).chr(hexdec('BB')).chr(hexdec('BF'))){ | |
return substr($s,3); | |
}else{ | |
return $s; | |
} | |
} |
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 FILTERS/HOOK/ACTIONS | |
// WP Filters | |
function hwy_change_my_array( $value ) { | |
$value['fourth'] = 4; | |
return $value; | |
} | |
add_filter( 'hwy_my_array', 'hwy_change_my_array' ); | |
function hwy_change_my_array_again( $value ) { | |
$value['second'] = 222; |
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
function example_shortcode( $atts ) { | |
$shortcode_output = "<p>Some shortcode content.</p>"; | |
$shortcode_output .= "<p>More shortcode content.</p>"; | |
ob_start(); | |
do_action('below_shortcode'); | |
$below_shortcode = ob_get_contents(); | |
ob_end_clean(); |
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
define( 'DISALLOW_FILE_EDIT', true ); // turn off Editors access for themes and plugin from admin | |
define( 'WP_AUTO_UPDATE_CORE', minor ); | |
define( 'WP_DEBUG', true ); // turns on debugging for WP. Must be on to write to log file | |
define( 'WP_DEBUG_DISPLAY', false ); // this turns off debug errors from showing on the front end | |
define( 'WP_DEBUG_LOG', true ); // turn on writing to WP debug log file | |
// allow to do updates from admin | |
define('FS_METHOD', 'direct'); |
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
error_reporting(E_ALL); | |
ini_set("display_errors", 1); |
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
/** Place this in themes functions.php file **/ | |
function my_always_get_post_custom( $posts ) { | |
for ( $i = 0; $i < count($posts); $i++ ) { | |
$custom_fields = get_post_custom( $posts[$i]->ID ); | |
$posts[$i]->custom_fields = $custom_fields; | |
} | |
return $posts; | |
} | |
add_filter( 'the_posts', 'my_always_get_post_custom' ); |
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
// Axios Globals | |
axios.defaults.headers.common["X-Auth-Token"] = | |
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; | |
// GET REQUEST | |
function getTodos() { | |
// axios({ | |
// method: "get", | |
// url: "https://jsonplaceholder.typicode.com/todos", | |
// params: { | |
// _limit: 5 |
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
/** template-directory.php file **/ | |
<?php | |
/** | |
* Template Name: Directory Template | |
* | |
* @package WordPress | |
* @subpackage Timber | |
* @since Timber 0.1 | |
*/ | |
use Classes\Helper; |
NewerOlder