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('wp', function(){ | |
global $wpdb; | |
$seo_title = "[:uk]TEST TITLE😜[:en]TEST TITLE😜[:]"; | |
$seo_description = "[:uk]Test description 👍[:en]Test description 👍[:]"; | |
$sql = "SELECT option_value FROM wp_options WHERE option_name = 'wpseo_taxonomy_meta'"; | |
$result = $wpdb->get_results($sql); |
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 getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
console.log( getElementByXpath("//html[1]/body[1]/div[1]") ); |
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 | |
$target = apply_filters( 'qtranslate_language_detect_redirect', $url_lang, $url_orig, $url_info ); | |
if ( $target !== false && $target != $url_orig ) { | |
//Custom code Start | |
$urlToArray = explode('/', $url_orig); | |
if(end($urlToArray) != "") | |
{ | |
$target .= '/'; | |
} | |
//Custom code End |
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: BP Add Page | |
* Plugin URI: https://webdevstudios.com | |
* Description: Example on adding a page to BuddyPress profiles | |
* Author: WebDevStudios | |
* Author URI: https://webdevstudios.com | |
* Version: 1.0.0 | |
* License: GPLv2 | |
*/ |
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 | |
$role = new WP_User( $userID ); | |
$role->add_cap('upload_files', true); | |
$role->add_cap('edit_published_pages', true); | |
add_filter( 'posts_where', 'devplus_attachments_wpquery_where' ); | |
function devplus_attachments_wpquery_where( $where ){ | |
global $current_user; |
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 | |
remove_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 10); | |
add_action('woocommerce_after_shop_loop', 'customPagination'); | |
function customPagination() | |
{ | |
if($_GET['view'] != 'all'){ | |
echo '<div class="product-view-all"><a href="?view=all">View All</a></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
import update from 'react-addons-update'; | |
let nextState = update(this.state.cards, { | |
[index] : { | |
tasks: {$splice: [[taskIndex, 1]]} | |
} | |
}); | |
//----------------------------------------------------- |
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_filter('listo_list_types', 'listo_list_types_func'); | |
function listo_list_types_func($list_types){ | |
$list_types['physicians'] = 'Listo_Physicians'; | |
return $list_types; | |
} | |
class Listo_Physicians implements Listo { | |
public static function items(){ |
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( 'woocommerce_add_to_cart', 'remove_cart2',10 , 6 ); | |
function remove_cart2($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data){ | |
global $woocommerce; | |
if ($woocommerce->cart->get_cart_contents_count() != 0) { | |
$cartQty = $woocommerce->cart->get_cart_item_quantities(); | |
$cartItems = $woocommerce->cart->cart_contents; | |
// Check if desired product is in cart already |
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 limit_file_upload_size( $validation_result ) { | |
$images = json_decode(json_decode('"'.$_POST['gform_uploaded_files'].'"', true)); | |
$form = $validation_result['form']; | |
foreach( $form['fields'] as &$field ){ | |
$is_hidden = RGFormsModel::is_field_hidden( $form, $field, array() ); |
NewerOlder