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 | |
// action is icl_register_admin_string and we want to handle it only for administrators | |
add_action( 'wp_ajax_icl_register_admin_string', 'icl_register_admin_string' ); | |
add_action( 'wp_ajax_nopriv_icl_register_admin_string', 'icl_register_admin_string_nopriv' ); | |
function icl_register_admin_string() { | |
// add code for http://codex.wordpress.org/Function_Reference/check_ajax_referer | |
if (curent_user_can('manage_options')) { |
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
/** | |
* Changes array of items into string of items, separated by comma and sql-escaped | |
* | |
* @see https://coderwall.com/p/zepnaw | |
* | |
* @global wpdb $wpdb | |
* @param array $items items to be joined into string | |
* @param string $format %s or %d | |
* @return string Items separated by comma and sql-escaped | |
*/ |
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
protected function save( $dest, $html_templates ) { | |
$order_language = get_post_meta( $this->order->id, 'wpml_language', true ); | |
$user_id = get_current_user_id(); | |
$temp_language = null; | |
if (is_numeric($user_id)) { | |
$temp_language = get_user_meta( $user_id, 'icl_admin_language_for_edit', true ); | |
update_user_meta($user_id, 'icl_admin_language_for_edit', $order_language); | |
do_action('wpml_switch_language', $order_language); | |
} |
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
#!/usr/bin/python | |
# 1. create file install.py inside of this directory with .sql files | |
# 2. place it inside of file (adjust dbname dbuser and dbpass) | |
# 3. run python install.py | |
from os import listdir | |
from os.path import isfile, join | |
from os import system |
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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
import time | |
wp_url = "http://localhost/qatests/" | |
wp_admin_url = wp_url + "wp-admin/" | |
wp_login_url = wp_url + "wp-login.php" | |
wp_plugins_url = wp_admin_url + "plugins.php" |
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
/** | |
* The following styles get applied inside the editor only. | |
* | |
* Replace them with your own styles or remove the file completely. | |
*/ | |
.wp-block-syntax-block-syntax-highliter { | |
border: 1px dotted #f00; | |
} |
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 code below to functions.php file of your theme | |
add_filter( 'the_content', function( $content ) { | |
if ( ! is_admin() ) { | |
$content = str_replace( 'WordPress', '<a href="https://wordpress.org">WordPress</a>', $content ); | |
} | |
return $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
// edit: if you are using wp-cli, you can try to use this plugin https://github.com/OnTheGoSystems/acfml_fixer | |
// otherwise, please follow instructions below | |
// PLEASE READ ALL COMMENTS BEFORE RUNNING THIS SNIPPET | |
// ALSO THE COMMENTS AT THE END OF THIS SNIPPET | |
// | |
// CREATE DATABASE BACKUP! | |
// | |
// update ACFML to the version 1.6.1, you can find it in wpml.org > my account > downloads | |
// add the whole snippet to your functions.php in theme directory and visit any page of your blog/site |
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
/**/_xdc_._sixyrm && _xdc_._sixyrm( { | |
"html_attributions" : [], | |
"result" : { | |
"address_components" : [ | |
{ | |
"long_name" : "Swansea", | |
"short_name" : "Swansea", | |
"types" : [ "locality", "political" ] | |
}, | |
{ |
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
diff --git a/wpforms/src/Admin/Payments/Views/Overview/Page.php b/wpforms/src/Admin/Payments/Views/Overview/Page.php | |
index a1879f46d..534dfd825 100644 | |
--- a/wpforms/src/Admin/Payments/Views/Overview/Page.php | |
+++ b/wpforms/src/Admin/Payments/Views/Overview/Page.php | |
@@ -118,7 +118,7 @@ class Page implements PaymentsViewsInterface { | |
static $mode; | |
- if ( ValueValidator::is_valid_mode( $mode ) ) { | |
+ if ( ValueValidator::is_valid( $mode, 'mode' ) ) { |
OlderNewer