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 ( document, $, undefined ) { | |
| /***** | |
| * SHOWING HOISTING WITH A VARIABLE | |
| */ | |
| // Let me show hoisting to you by demonstrating a variable and it's | |
| // initialization with a value | |
| // 1. You get "undefined" here - but NOT an error. | |
| console.log( hoistingVariable ); | |
| var hoistingVariable = 'I am initializing it now.'; |
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 | |
| /** | |
| * Fetch user meta for the specified role and return user ID, first name, and last name | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param string $role | |
| * @return array | |
| */ |
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 | |
| /** | |
| * 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. | |
| * |
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
| // 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 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 | |
| /** | |
| * Restrict Media Library by User Role | |
| * | |
| * @package Restrict_Media_Library | |
| * @since 1.0.0 | |
| * @author hellofromTonya | |
| */ | |
| /** |
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
| /** | |
| * 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 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 namespace WPDevsClub_Lesson_Var_Vars; | |
| class Meta implements I_Meta { | |
| protected $post_id = 0; | |
| protected $meta_key = ''; | |
| protected $defaults = array(); |
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 | |
| $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 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 namespace wpdevsclub_demo; | |
| use Closure; | |
| class Calculator { | |
| public function solve( Closure $expression, $args ) { | |
| if ( is_callable( $expression ) ) { | |
| return $expression( $args ); |
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 | |
| /** | |
| * Add class to the HTML Body tag | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param array $classes | |
| * @return array | |
| */ |