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 ($) { | |
'use strict'; | |
function change_avatar_div( e ){ | |
var field = $(e.currentTarget); | |
var acw_avatar_div = field.closest('.acw-thumb-size-wrap').find('.acw-avatar'); | |
if( acw_avatar_div.length ) { | |
var icon = $( '.acw-icon', acw_avatar_div); |
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 | |
function bootstrap_link_pages( $args = '' ) { | |
$defaults = array( | |
'before' => '<p>' . __( 'Pages:' ), | |
'after' => '</p>', | |
'link_before' => '', | |
'link_after' => '', | |
'next_or_number' => 'number', | |
'nextpagelink' => __( 'Next page' ), |
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 | |
function _dbdb_wp_count_posts( $counts, $type, $perm ) { | |
global $pagenow; | |
if( 'edit.php' !== $pagenow ){ | |
return $counts; | |
} | |
if( current_user_can( 'manage_options' ) ){ | |
return $counts; |
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 | |
/** | |
* This will ADD a custom taxonomy to the allowed taxonomies used by the widget | |
* */ | |
function filter_acatw_allowed_taxonomies( $taxonomies ){ | |
$taxonomies['project_category']= 'Project Categories'; | |
return $taxonomies; | |
} |
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
jQuery(document).ready(function($) { | |
tinymce.create( 'tinymce.plugins.dbdb_social_button', { | |
/** | |
* Initializes the plugin, this will be executed after the plugin has been created. | |
* This call is done before the editor instance has finished its initialization so use the onInit event | |
* of the editor instance to intercept that event. | |
* | |
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. |
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 | |
/** | |
* Instagram scraper | |
* | |
* Quick and dirty Instragram scraper for displaying a Instagram feed. | |
* | |
* Based on : https://gist.github.com/cosmocatalano/4544576 | |
* | |
* @param string $username Instagram user account |
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
<ul> | |
<?php | |
global $post; | |
$args = array( 'numberposts' => 5, 'post_type' => 'article' ); | |
$myposts = get_posts( $args ); | |
foreach( $myposts as $post ) : | |
setup_postdata($post); ?> | |
<li> | |
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /> | |
<?php the_excerpt();?> |
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( 'rest_endpoints', function( $endpoints ){ | |
if( isset( $endpoints[ '/wp/v2/posts' ] ) ){ | |
foreach( $endpoints[ '/wp/v2/posts' ] as &$post_endpoint ){ | |
if( ! empty( $post_endpoint[ 'methods' ] ) && 'GET' == $post_endpoint[ 'methods' ] ){ | |
$post_endpoint[ 'args' ][ 'type' ] = array( | |
'description' => 'Post types', | |
'type' => 'array', | |
'required' => false, | |
'default' => 'post' |
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($) { | |
$( document ).ready(function() { | |
var $sideNavs = $(); | |
$.fn.toggleHeight = function( options ){ | |
if( 'ontouchstart' in document ) return this; |