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 | |
| /* | |
| Plugin Name: WP_Rewrite endpoints demo | |
| Description: A plugin giving example usage of the WP_Rewrite endpoint API | |
| Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ | |
| Author: Jon Cave | |
| Author URI: http://joncave.co.uk/ | |
| */ | |
| function makeplugins_endpoints_add_endpoint() { |
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 | |
| // This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
| // ... | |
| // register and enqueue loadCSS | |
| function load_scripts_and_styles() { | |
| // register loadCSS | |
| wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', false ); |
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
| import { withRouter } from 'next/router'; | |
| import Link from 'next/link'; | |
| import React, { Children } from 'react'; | |
| const ActiveLink = ({ router, children, ...props }) => { | |
| const child = Children.only(children); | |
| let className = child.props.className || ''; | |
| if (router.pathname === props.href && props.activeClassName) { | |
| className = `${className} ${props.activeClassName}`.trim(); |
OlderNewer