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 this test script to wp-content/mu-plugins/test-trac53770.php | |
// Add the function into the theme where the site logo is rendered. | |
function test_trac53770_logo() { | |
$theme = get_option( 'stylesheet' ); | |
$mods = get_theme_mods(); | |
$options = array( | |
'get theme mods' => array( |
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 | |
// Location of this code: wp-content/mu-plugins/t53165.php. | |
namespace Test\t53165; | |
add_action( 'init', __NAMESPACE__ . '\register_test_taxonomy' ); | |
function register_test_taxonomy() { | |
$labels = array( | |
'name' => 'Tests', | |
'singular_name' => 'Test', |
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 Testing\Ticket51423; | |
add_action( 'wp_privacy_personal_data_export_file', __NAMESPACE__ . '\setup_testing_export_file', 5 ); | |
function setup_testing_export_file( $request_id ) { | |
$GLOBALS['testing_51423'] = array( | |
'request_id' => $request_id, | |
'_export_data_grouped' => get_post_meta( $request_id, '_export_data_grouped', true ), | |
); |
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
<!DOCTYPE html> | |
<html lang="en-US" class="js svg background-fixed"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="profile" href="http://gmpg.org/xfn/11"> | |
<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script> | |
<title>Blog - Testing page</title> | |
<link rel="dns-prefetch" href="//fonts.googleapis.com"> | |
<link href="https://fonts.gstatic.com" crossorigin="" rel="preconnect"> |
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
//* Make sure your child theme has this line in the functions.php file | |
add_theme_support('genesis-after-entry-widget-area'); | |
add_action( 'genesis_after_entry', 'lunarwp_add_after_entry_widget_area' ); | |
/** | |
* Display after-entry widget area on the genesis_after_entry action hook. | |
* | |
* @since 1.0.0 | |
* | |
* @uses genesis_widget_area() Output widget area. |
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
/** | |
* Return compatibility strings. | |
* | |
* @since 5.6.0 | |
* | |
* @param string $key The key for the particular string. | |
* Default is false. | |
* @param string $name Plugin or theme name. | |
* | |
* @return string The appropriate compatibilty string. |
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 | |
require_once __DIR__ . '/debug-toolkit/debug-toolkit.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
<?php | |
add_action( 'init', function() { | |
/** | |
* 1. PHP adds the variable into the symbols table. | |
* 2. PHP adds the value into the data table, which is called zval. | |
* 3. PHP points the value location to the variable location, binding them together. | |
* 4. refcount is incremented to 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
[alias] | |
# Opens the Atom editor. | |
atom = ! atom | |
# =================================== | |
# Viewing history | |
# =================================== | |
# Shows a graphical log. | |
logone = log --oneline --decorate --all --graph |
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
def longest_consecutive_subsequence(input_list): | |
""" | |
Gets the longest sequential (consecutive set of numbers from the given unsorted list. | |
Time complexity is O(n) and space complexity is O(n). | |
This design uses Python's `range()` function to generate the list of sequential numbers. To accomplish this, | |
we iterate through the input list to find the least starting number and the number of sequential numbers. | |
It works on all integers. |