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( 'add_meta_boxes', 'add_page_scripts' ); | |
/** | |
* Register the metabox | |
*/ | |
function add_page_scripts() { | |
add_meta_box( 'page-scripts', __( 'Page Scripts & Styles', 'textdomain' ), 'add_page_metabox_scripts_html', 'page', 'advanced' ); | |
} |
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 | |
namespace My_Plugin\API; | |
/** | |
* API Functions | |
*/ | |
if( ! defined( 'ABSPATH' ) ) { | |
return; | |
} |
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 | |
namespace Simple_Product_Subscriptions; | |
class Cart { | |
/** | |
* Cart Hooks |
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 | |
/** | |
* Installer class | |
*/ | |
namespace MyPlugin; | |
class Installer { | |
// ... previous code |
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 | |
/** | |
* Checkout Form | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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_filter( 'posts_clauses', 'filter_clauses', 10, 2 ); | |
/** | |
* Filtering everything. | |
* | |
* @param array $clauses Array with all parts of the query. | |
* @param WP_Query $wp_query Object. | |
* @return string |
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( 'publish_future_post', 'automation_on_publish', 20, 1 ); | |
/** | |
* Create automate tasks on post publish. | |
* | |
* @param integer $post_id Post ID that is published. | |
*/ | |
function automation_on_publish( $post_id ) { |
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( 'admin_enqueue_scripts', 'books_enqueue_scripts' ); | |
function books_enqueue_scripts( $hook ){ | |
$hook_scripts = false; | |
if( $hook_suffix == "post-new.php" && isset( $_GET["post_type"] ) && $_GET["post_type"] == "books" ){ | |
$hook_scripts = 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
class App extends React.Component { | |
render() { | |
return ( | |
bla | |
) | |
} | |
} | |
const element = <App /> |
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 | |
// Should this data be added? | |
apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); | |
// Do something before we add the data | |
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value ); | |
// Do Something after the data has been added | |
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value ); |
NewerOlder