This file contains hidden or 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 | |
| // Define a Docker environment constant with the value | |
| define( 'WP_ENVIRONMENT_TYPE', getenv_docker('WORDPRESS_ENV', 'local') ); | |
| /* | |
| * To use this, you should add a conditional | |
| * | |
| * ``` | |
| * if( wp_get_environment_type() === 'local' ) { | |
| * // your code |
This file contains hidden or 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
| <label for="check">Check</label> | |
| <input | |
| type="checkbox" | |
| class="ui-toggle" | |
| id="check" | |
| name="check" | |
| value="1" | |
| > |
This file contains hidden or 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
| === Plugin Name === | |
| . | |
| . | |
| . | |
| Requires at least: 5.9 | |
| Tested up to: 5.9.3 | |
| Requires PHP: 8.0 | |
| WC requires at least: 6.0 | |
| WC tested up to: 6.0 | |
| License: GPLv2 or later |
This file contains hidden or 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 | |
| define('FORCE_SSL_ADMIN', false); | |
| define('rsssl_no_wp_redirect', true); | |
| define('rsssl_no_rest_api_redirect', true); |
This file contains hidden or 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 | |
| spl_autoload_register(function($required_file) { | |
| # Transform file name from class based to file based | |
| $fixed_name = strtolower( str_ireplace( '_', '-', $required_file ) ); | |
| $file_path = explode( '\\', $fixed_name ); | |
| $last_index = count( $file_path ) - 1; | |
| $file_name = "class-{$file_path[$last_index]}.php"; | |
| # Get fully qualified path |
This file contains hidden or 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
| // To add the text dynamically, use a class (overlay-title) in the h2 to catch the object and modify h2::before for "overlay-title-shadow" | |
| (function( $ ) { | |
| 'use strict'; | |
| // Window loaded | |
| $(window).on("load",function(){ | |
| const postTitleObj = $( '.overlay-title h2' ); | |
| if( 0 < postTitleObj.length ) { | |
| postTitleObj.before( '<div class="overlay-title-shadow">' + postTitleObj.html() + '</div>' ); | |
| } |
This file contains hidden or 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 | |
| # After enquequing the JS add this localization to add the nonce and other variables | |
| $params = [ | |
| 'action' => 'your_action', | |
| 'wp_nonce' => wp_create_nonce( 'wp_ajax_nonce' ), | |
| 'error' => __('There was an error with the Ajax call. Please try again later'), | |
| ]; | |
| wp_localize_script( 'custom_ajax_params', 'wp_globals', $params ); |
This file contains hidden or 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
| /** Get a value from the Query params */ | |
| function otkGetQueryParam(name, url = window.location.href) { | |
| let objectURL = new URL( url ); | |
| let searchParams = new URLSearchParams( objectURL.search ); | |
| return searchParams.get(name); | |
| } | |
| /** Set a value to the Query params */ | |
| function otkSetQueryParam(name, url = window.location) { | |
| const urlObj = new URL(url); |
This file contains hidden or 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 | |
| /** | |
| * @since 1.0.0 | |
| * | |
| * @param $plugin_name | |
| */ | |
| public static function activate($plugin_name) { | |
| # Initialize variables |
This file contains hidden or 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( $ ) { | |
| 'use strict'; | |
| // DOM ready | |
| $(function() { | |
| }); | |
| // Window loaded | |
| $(window).on("load",function(){ |