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 | |
use craft\elements\Entry; | |
use craft\helpers\UrlHelper; | |
return [ | |
'endpoints' => [ | |
'news.json' => function() { | |
return [ | |
'elementType' => Entry::class, | |
'criteria' => ['section' => 'news'], |
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
<script> | |
// load a language | |
numeral.language('fr', { | |
delimiters: { | |
thousands: ' ', | |
decimal: ',' | |
}, | |
abbreviations: { | |
thousand: 'k', | |
million: 'm', |
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 | |
/** | |
* WordPress function for redirecting users on login based on user role | |
*/ | |
function my_login_redirect( $url, $request, $user ){ | |
if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) { | |
if( $user->has_cap( 'administrator' ) ) { | |
$url = admin_url(); | |
} else { |
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
add_action( 'elementor/element/button/section_style/after_section_start', 'custom_button_field', 10, 2 ); | |
/** | |
* Adding button fields | |
* @param \Elementor\Widget_Base $button | |
* @param array $args | |
*/ | |
function custom_button_field( $button, $args ) { | |
$button->add_control( 'custom_button_type', | |
[ | |
'label' => __( 'Button Type', 'elementor' ), |
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"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content="Multi step/part form designed using bootstrap 4 for responsive and mobile first. This form also includes parseley validation." | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css"> |
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 logout URL and redirect to homepage | |
* | |
* Allows you to place a logout link within the WordPress editor. In visual | |
* view set the link to [logout-url], in text view, use | |
* <a href="[logout-url]">logout</a>. | |
* | |
* @author Phil Wylie | |
* @link http://goo.gl/025f5 | |
*/ |