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 | |
$remote_request = new WordPressRemoteJSON( 'https://leanpub.com/wpb3/coupons.json', array( 'body' => array("coupon_code" => "coupon-code-123456" ) ), "post" ); | |
$remote_request->run(); //False |
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: Elementor Widget | |
* Text Domain: elementor-widget | |
* Domain Path: /languages | |
* Version: 0.1.0 | |
* | |
* @package Elementor_Widget | |
*/ |
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_enqueue_scripts', 'enqueue_if_shortcode'); | |
function enqueue_if_shortcode(){ | |
global $post; | |
if ( $post && has_shortcode( $post->post_content, 'your_shortcode_tag' ) { | |
// Enqueue | |
} |
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($){ | |
$(function(){ | |
$(document.body).on( 'change', '#min_price, #max_price', function(){ | |
var minPrice = parseFloat( $('#min_price').val() ); | |
var maxPrice = parseFloat( $('#max_price').val() ); | |
$('.item-list li').each(function(){ | |
var price = parseFloat( $(this).attr('data-price') ); |
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', 'ibenic_register_hide_shortcode' ); | |
function ibenic_register_hide_shortcode() { | |
add_shortcode( 'hide_content_if', 'ibenic_hide_content_if' ); | |
} | |
function ibenic_hide_content_if( $atts, $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
function App() { | |
const [loading, setLoading] = useState(false); | |
const [articles, setArticles] = useState([]); | |
const [notFoundSlugs, setNotFoundSlugs] = useState([]); // Adding not found slugs | |
// ... other code | |
} |
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
// Adding the React Router | |
import React, { useState, useEffect } from 'react'; | |
import './App.scss'; | |
import { | |
BrowserRouter as Router, | |
Switch, | |
Route, | |
Link, | |
useParams | |
} from "react-router-dom"; |
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: Live API | |
*/ | |
add_action( 'init', function(){ | |
add_shortcode( 'live_api', 'live_api_shortcode' ); | |
}); | |
function live_api_shortcode() { |
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( 'add_meta_boxes', 'add_page_scripts' ); | |
/** | |
* Register the metabox | |
*/ | |
function add_page_scripts() { | |
add_meta_box( 'page-scripts', __( 'Page Scripts & Styles', 'textdomain' ), 'add_page_metabox_scripts_html', 'page', 'advanced' ); | |
} |
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 My_Plugin\API; | |
/** | |
* API Functions | |
*/ | |
if( ! defined( 'ABSPATH' ) ) { | |
return; | |
} |
NewerOlder