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
array( | |
array( | |
'label' => __('Field[ input ] Type[ text ]', 'fh'), | |
'type' => 'input', | |
'field' => array( | |
'type' => 'text', | |
'name' => 'fh_text', | |
'class' => 'widefat', | |
'value' => get_option('fh_text') | |
) |
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
/* | |
* Ajax post loader | |
**/ | |
if (1) { | |
$('main').on('click', '.blog-page-mehr', function (e) { | |
e.preventDefault(); | |
var $text = $(this).html(), | |
$this = $(this), | |
$data_attr = $.parseJSON($(this).attr('data-ajax-more')), | |
$data = {}; |
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
if (1) { | |
$('.main').on('submit', 'selector', function (e) { | |
var $form = $(this); | |
e.preventDefault(); | |
wp.ajax.send('action_name', { | |
success: function (response) { | |
$('.alert', $form).addClass('succes').text(response.message); | |
$($form)[0].reset(); | |
setTimeout(function () { | |
$('.alert', $form).removeClass('succes'); |
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_shortcode( 'video', function ( $atts, $content ) | |
{ | |
$output = wp_video_shortcode( $atts, $content ); | |
if( ! isset( $atts['muted'] ) || ! wp_validate_boolean( $atts['muted'] ) ) | |
return $output; | |
if( false !== stripos( $output, ' muted="1"' ) ) | |
return $output; |
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 example_ajax_enqueue() { | |
// Enqueue javascript on the frontend. | |
wp_enqueue_script( | |
'example-ajax-script', | |
get_template_directory_uri() . '/js/simple-ajax-example.js', | |
array('jquery','wp-util') | |
); | |
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 | |
/* | |
* Paginate Advanced Custom Field repeater | |
*/ | |
if( get_query_var('page') ) { | |
$page = get_query_var( 'page' ); | |
} else { | |
$page = 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
.acf-fc-popup .preview { | |
position: absolute; | |
right: 100%; | |
margin-right: 0px; | |
top: 0; | |
background: #383c44; | |
min-height: 100%; | |
border-radius: 5px; | |
align-content: center; | |
display: grid; |
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
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const el = wp.element.createElement; | |
registerBlockType( 'hiRoy/serverSide', { | |
title: __( 'Server Side Block', 'text-domain' ), | |
icon: 'networking', | |
category: 'common', | |
attributes: { |
OlderNewer