Skip to content

Instantly share code, notes, and snippets.

View iamcanadian1973's full-sized avatar

Kyle Rumble iamcanadian1973

View GitHub Profile
<?php
function _s_get_textarea( $text ) {
if( empty( $text ) ) {
return false;
}
return wpautop( $text );
}
<?php
/**
* Load a template part into a template
*
* Makes it easy for a theme to reuse sections of code in a easy to overload way
* for child themes.
*
* Includes the named template part for a theme or if a name is specified then a
* specialised part will be included. If the theme contains no {slug}.php file
<?php
/**
* Checks if the the post has excerpt or not
* Code reference: https://wordpress.stackexchange.com/a/52897/12615
*/
//
function wpse_40574_populate_excerpt( $data, $postarr )
{
if( ! isset( $data['news'] ) ) {
@iamcanadian1973
iamcanadian1973 / query-vars.php
Last active January 19, 2018 22:31
Query vars
<?php
$activation_key = '';
if( isset( $_GET['activation_key'] ) && ! empty( $_GET['activation_key'] ) ) {
$activation_key = $_GET['activation_key'];
}
if( !empty( $activation_key ) ) {
<?php
// Add group custom group attribute to check later
add_filter( 'ld_course_list_shortcode_attr_defaults', function( $defaults ) {
$defaults['mygroups'] = null;
return $defaults;
}, 10 );
$folder = '';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"){$ssl_set = "s";} else{$ssl_set = "";}
if(isset($folder) && $folder != ''){ $folder = '/' . $folder;}
define('WP_HOME', 'http'.$ssl_set.'://'.$_SERVER['HTTP_HOST'].$folder); // no trailing slash
define('WP_SITEURL', 'http'.$ssl_set.'://'.$_SERVER['HTTP_HOST'].$folder); // no trailing slash
<?php
/*
WPFront Notification Bar Plugin
Copyright (C) 2013, WPFront.com
Website: wpfront.com
Contact: syam@wpfront.com
WPFront Notification Bar Plugin is distributed under the GNU General Public License, Version 3,
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110, USA
<?php
add_filter( 'wpfront_notification_bar_message', function( $message ) {
$message = apply_filters( 'wpml_translate_single_string', $message, 'admin_texts_wpfront-notification-bar-options', '[wpfront-notification-bar-options]message', apply_filters( 'wpml_current_language', NULL ) );
return $message;
});
add_filter( 'wpfront_notification_bar_button_text', function( $button_text ) {
$button_text = apply_filters( 'wpml_translate_single_string', $button_text, 'admin_texts_wpfront-notification-bar-options', '[wpfront-notification-bar-options]button_text', apply_filters( 'wpml_current_language', NULL ) );
return $button_text;
@iamcanadian1973
iamcanadian1973 / wpml.config
Created April 7, 2020 21:55
Flatsome page builder
<wpml-config>
<custom-types>
<custom-type translate="1">blocks</custom-type>
<custom-type translate="1">featured_item</custom-type>
</custom-types>
<taxonomies>
<taxonomy translate="1">block_categories</taxonomy>
<taxonomy translate="1">featured_item_category</taxonomy>
<taxonomy translate="0">featured_item_tag</taxonomy>
</taxonomies>