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 | |
/** | |
* Replace the default "_" (underscore) with "-" (hyphen) in protected custom fields for debugging purposes | |
* | |
* @param bool $protected The default value | |
* @param string $meta_key The meta key | |
* @return bool True for meta keys starting with "-" (hyphen), false otherwise | |
*/ | |
function unprotected_meta( $protected, $meta_key ) { |
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 | |
// Número de posts em destaque | |
$n = 5; | |
// Recebe os sticky posts e os ordena por ID de forma decrescente | |
$sticky_posts = get_option( 'sticky_posts' ); | |
rsort( $sticky_posts ); | |
// Verifica se há sticky posts |
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 | |
/** | |
* Customize Image Reloaded Class | |
* | |
* Extend WP_Customize_Image_Control allowing access to uploads made within | |
* the same context | |
*/ | |
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control { | |
/** | |
* Constructor. |
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 | |
/** | |
* Cria o Widget que mostra os posts da categoria selecionada | |
* | |
*/ | |
class Recent_Category_Posts extends WP_Widget { | |
/** | |
* Constructor | |
* |
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 | |
/** | |
* @link http://wordpress.stackexchange.com/questions/70752/featured-image-of-video-from-oembed | |
*/ | |
class FeaturedVideo | |
{ | |
/** | |
* The post thumbnail 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 | |
/** | |
* Get all the registered image sizes along with their dimensions | |
* | |
* @global array $_wp_additional_image_sizes | |
* | |
* @link http://core.trac.wordpress.org/ticket/18947 Reference ticket | |
* @return array $image_sizes The image sizes | |
*/ | |
function _get_all_image_sizes() { |
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 | |
// Change this to your own taxonomy and post type | |
new Tag_Checklist( 'taxonomy_name', 'post_type' ); | |
/** | |
* Use checkbox term selection for non-hierarchical taxonomies | |
* | |
* @author Hugh Lashbrooke |
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 | |
/** | |
* Retrieve the attachment ID from the file URL | |
* | |
* @link http://pippinsplugins.com/retrieve-attachment-id-from-image-url/ | |
*/ | |
function horizonte_rural_get_attachment_id( $image_url ) { | |
global $wpdb; | |
$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $wpdb->posts . " WHERE guid='%s';", $image_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
=== PLUGIN_NAME === | |
Contributors: eduardozulian | |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H28V8F5PHSZHA | |
Tags: | |
Requires at least: 3.0 | |
Tested up to: 3.8 | |
Stable tag: 1.0 | |
License: GPLv2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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 | |
/* | |
Plugin Name: | |
Plugin URI: | |
Description: | |
Version: 0.1 | |
Author: Eduardo Zulian | |
Author URI: | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
OlderNewer