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 prefix_setup_theme() { | |
add_theme_support( 'editor-font-sizes', array( | |
array( | |
'name' => __( 'Small', 'themeLangDomain' ), | |
'size' => 12, | |
'slug' => 'small' | |
), |
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 prefix_setup_theme() { | |
add_theme_support( 'editor-color-palette', array( | |
array( | |
'name' => __( 'Strong Magenta', 'themeLangDomain' ), | |
'slug' => 'strong-magenta', | |
'color' => '#a156b4', | |
), |
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 | |
$mysqli = new mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME ) or die( 'Could not connect' ); | |
// Check connection | |
if ( mysqli_connect_errno() ) { | |
printf( "Connect failed: %s\n", mysqli_connect_error() ); | |
exit(); | |
} |
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 prefix_paginate_links() { | |
global $wp_query; | |
$big = 999999999; // This needs to be an unlikely integer | |
$args = array( | |
'base' => str_replace( $big, '%#%', get_pagenum_link($big) ), |
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
import React from 'react'; | |
export class Example extends React.Component { | |
componentWillUnmount() { | |
alert('Goodbye world'); | |
} | |
render() { | |
return <h1>Hello world</h1>; | |
} |
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
import React from 'react'; | |
export class Example extends React.component { | |
componentDidUpdate(prevProps, prevState) { | |
alert('Component is done rendering!'); | |
} | |
render() { | |
return <h1>Hello world</h1>; | |
} |
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
import React from 'react'; | |
export class Example extends React.Component { | |
componentWillUpdate(nextProps, nextState) { | |
alert('Component is about to update! Any second now!'); | |
} | |
render() { | |
return <h1>Hello world</h1>; | |
} |
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
import React from 'react'; | |
export class Example extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { subtext: 'Put me in an <h2> please.' }; | |
} | |
shouldComponentUpdate(nextProps, nextState) { |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
const yellow = 'rgb(255, 215, 18)'; | |
export class TopNumber extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { 'highest': 0 }; | |
} | |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
export class Flashy extends React.Component { | |
componentWillMount() { | |
alert('AND NOW, FOR THE FIRST TIME EVER... FLASHY!!!!'); | |
} | |
componentDidMount() { | |
alert('YOU JUST WITNESSED THE DEBUT OF... FLASHY!!!!!!!'); |