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 | |
/** | |
* An helper file for Laravel 4, to provide autocomplete information to your IDE | |
* Generated for Laravel 4.2.16 on 2014-12-24. | |
* | |
* @author Barry vd. Heuvel <[email protected]> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
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_filter( 'single_template', array( | |
__CLASS__, | |
'get_custom_post_type_template' | |
), 10, 1 ); | |
public function get_custom_post_type_template( $single_template ) { | |
global $post; |
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
.ad { | |
background-color: $grey; | |
&.box-728x90 { | |
height: 90px; | |
width: 728px; | |
} | |
&.box-300x600 { | |
height: 600px; | |
} | |
&.box-300x250 { |
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 | |
//Update profile for WP Users | |
add_action( 'profile_update', array( $this, 'bps_users_save_metadata' ), 10, 2 ); | |
//Adding fields to normal user profile | |
add_action( 'show_user_profile', array( $this, 'bps_custom_user_profile_fields' ) ); | |
add_action( 'edit_user_profile', array( $this, 'bps_custom_user_profile_fields' ) ); | |
/** |
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
//Setting Ajax handlers | |
add_action( 'wp_ajax_nopriv_get_author_info', array( $this, 'bps_get_author_info_cb' ) ); | |
add_action( 'wp_ajax_get_author_info', array( $this, 'bps_get_author_info_cb' ) ); | |
/** | |
* Function used to get author info for popup on article | |
*/ | |
public function bps_get_author_info_cb() { | |
global $coauthors_plus; | |
//Checking nonce |
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
/* global jQuery, wp */ | |
/** | |
* To enqueue in admin: | |
* $template_dir = get_template_directory_uri(); | |
* //Enqueue necessary scripts for using WP JS media library | |
* wp_enqueue_media(); | |
* //Custom JS for admin | |
* wp_enqueue_script( 'coresales-admin-scripts', $template_dir . '/javascripts/coresales_media_admin.min.js', array( 'jquery' ), 1.0, true ); | |
*/ |
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 | |
//Categories hooks | |
add_action( 'edit_category_form_fields', [ $this, 'coresales_category_custom_fields' ] ); | |
add_action( 'category_add_form_fields', [ | |
$this, | |
'coresales_category_custom_fields' | |
] ); //@see https://developer.wordpress.org/reference/hooks/taxonomy_add_form_fields/ | |
add_action( 'create_category', [ $this, 'coresales_category_save' ] ); | |
add_action( 'edit_category', [ $this, 'coresales_category_save' ] ); |
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
//Load/Enqueue the twitter widgets.js | |
window.twttr.ready(function (twttr) { | |
// At this point the widget.js file had been loaded. | |
// We can now make use of the twttr events | |
twttr.events.bind('rendered', function (event) { | |
// At this point the tweet as been fully loaded | |
// and rendered and you we can proceed with our Javascript | |
window.console.log("Created widget", event.target.id); | |
}); | |
}); |
OlderNewer