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 tonya; | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
add_action( 'genesis_entry_header', 'tonya\do_post_grid_image', 1 ); | |
/** | |
* Echo the post image | |
* | |
* @since 1.1.0 | |
* | |
* @uses render_post_featured_image() |
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( 'loop_end', 'tonya_get_list_of_post_ids_in_current_loop' ); | |
/** | |
* Get a list of Post IDs for the current Loop. | |
* | |
* Hooks into 'loop_end' which occurs when WP_Query is done with the | |
* loop (see wp-includes/query.php). | |
* | |
* @since 1.0.0 |
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 class to the HTML Body tag | |
* | |
* @since 1.0.0 | |
* | |
* @param array $classes | |
* @return 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 namespace wpdevsclub_demo; | |
use Closure; | |
class Calculator { | |
public function solve( Closure $expression, $args ) { | |
if ( is_callable( $expression ) ) { | |
return $expression( $args ); |
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 | |
$variable_name = 'post_id'; | |
$$variable_name = 10; | |
//* Or use curly braces to specify exactly which variable is being used | |
//* as the variable variable, i.e. variable name | |
${$variable_name} = 10; | |
/** |
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 WPDevsClub_Lesson_Var_Vars; | |
class Meta implements I_Meta { | |
protected $post_id = 0; | |
protected $meta_key = ''; | |
protected $defaults = 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
/** | |
* Get the number of meta for a specific Post ID | |
* | |
* @since 1.0.0 | |
* | |
* @param integer $post_id Post ID to query for | |
* @return integer Returns the count number | |
*/ | |
function tonya_get_meta_count_for_post_id( $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 | |
/** | |
* Restrict Media Library by User Role | |
* | |
* @package Restrict_Media_Library | |
* @since 1.0.0 | |
* @author hellofromTonya | |
*/ | |
/** |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
/** | |
* As part of our weekly challenges, take a crack at this one. | |
* To play along, | |
* 1. Copy the code into a Gist, | |
* 2. Answer each of the questions by supplying the code; | |
* 3. Provide some notes as to your train of thought; | |
* 4. Then submit the gist's URL for us to review. | |
* |