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
function spa_integration_language_form() { | |
include_once SF_PLUGIN_DIR.'/admin/library/sp-languages.php'; | |
global $siteLang, $locale; | |
# Get user language setting | |
$siteLang = $locale; | |
//* var_dump($locale); // Result = 'fr_FR' | |
//* var_dump($siteLang); // Result = 'fr_FR' | |
if(!empty($siteLang)) { |
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
# ------------------------------------------------------------------ | |
# sp_localisation() | |
# Setup the forum localisation | |
# ------------------------------------------------------------------ | |
function sp_localisation() { | |
# i18n support | |
global $spPaths; | |
$locale = get_locale(); |
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
add_filter( 'wp_get_attachment_url', 'lunarwp_modify_attachment_url', 10, 2 ); | |
/** | |
* Replace out hex characters in an URL | |
* | |
* @since 1.0.0 | |
* | |
* @param string $url Attachment URL | |
* @param integer $post_ID Optional. Attachment ID. Default 0. | |
* @return string Returns the amended attachment url | |
*/ |
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
/** | |
* An example of how to call it | |
*/ | |
add_action( 'wp_head', function() { | |
print_list_hooked_functions( 'genesis_header' ); | |
} ); | |
/** | |
* Print a list of all hooked functions | |
* |
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(); |