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
/** | |
* Trims a string of words to a specified number of characters, gracefully stopping at white spaces. | |
* Also strips HTML tags, to prevent breaking in the middle of a tag. | |
* | |
* @param string $text The string of words to be trimmed. | |
* @param int $length Maximum number of characters; defaults to 45. | |
* @param string $append String to append to end, when trimmed; defaults to ellipsis. | |
* | |
* @return String of words trimmed at specified character length. | |
* |
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 removes the ability to add the FULL image size into a post, it does not alter or delete the image | |
* Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size | |
* | |
* For now we have to do it this way to make the labels translatable, see trac ref below. | |
* | |
* If your theme has $content_width GLOBAL make sure and remove it |
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
/** | |
** Check what else is hooking into the_content(); | |
** | |
**/ | |
add_action('template_redirect', 'wpse_44152_template_redirect'); | |
function wpse_44152_template_redirect(){ | |
global $wp_filter; | |
print_r($wp_filter['the_content']); | |
} |
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
echo 'dafdsagmdagafas fda ga fadfs das f'; |
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 GM\VirtualPages; | |
/** | |
* @author Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com> | |
* @license http://opensource.org/licenses/MIT MIT | |
*/ | |
class Controller implements ControllerInterface { | |
private $pages; |
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 | |
/** | |
* @package Smashing_plugin | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Smashing plugin | |
Plugin URI: https://www.smashingmagazine.com/2016/03/advanced-wordpress-search-with-wp_query/ | |
Description: This is an example plugin for Smashing Magazine readers. | |
Author: Carlo Daniele |
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 | |
/** | |
* @package Smashing_plugin | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Smashing plugin | |
Plugin URI: https://www.smashingmagazine.com/2016/03/advanced-wordpress-search-with-wp_query/ | |
Description: This is an example plugin for Smashing Magazine readers. | |
Author: Carlo Daniele |
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: Double Post Type Rewrite Rule Example | |
* Plugin URI: https://gist.github.com/mattyza/7dfd156992f23835f68e | |
* Description: Adds a custom rewrite rule to mimic http://domain.com/post-type-01/post-type-02/. | |
* Author: Matty Cohen | |
* Author URI: http://matty.co.za/ | |
* Version: 1.0.0 | |
* Stable tag: 1.0.0 | |
* License: GPL v3 - http://www.gnu.org/licenses/old-licenses/gpl-3.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
function custom_use_customer_from_address ( $from_email, $obj ) { | |
if ( is_a( $obj, 'WC_Email_New_Order' ) ) { | |
$address_details = $obj->object->get_address( 'billing' ); | |
if ( isset( $address_details['email'] ) && '' != $address_details['email'] ) { | |
$from_email = $address_details['email']; | |
} | |
} | |
return $from_email; | |
} | |
add_filter( 'woocommerce_email_from_address', 'custom_use_customer_from_address', null, 2 ); |
OlderNewer