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
/** | |
* WordPress dependencies | |
* https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/archives/edit.js | |
*/ | |
// ... hidden code for tutorial purposes | |
import ServerSideRender from '@wordpress/server-side-render'; | |
export default function ArchivesEdit( { attributes, setAttributes } ) { | |
const { showPostCounts, displayAsDropdown } = attributes; |
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 | |
/** | |
* Adding the payment fragment to the WC order review AJAX response | |
*/ | |
add_filter( 'woocommerce_update_order_review_fragments', 'my_custom_payment_fragment' ); | |
/** | |
* Adding our payment gateways to the fragment #checkout_payments so that this HTML is replaced with the updated one. | |
*/ | |
function my_custom_payment_fragment( $fragments ) { |
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 { TextControl, Button, Notice } from '@wordpress/components'; | |
import LoginGoogle from './login/LoginGoogle'; //Adding Google Component | |
const axios = require('axios'); | |
class Login extends React.Component { | |
constructor( props ) { | |
super( props ); | |
// ... previous bindings are here. |
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
// ... | |
.components-drop-zone__provider { | |
min-height: 100px; | |
height: auto; | |
width: 100%; | |
position: relative; | |
padding: 1em; | |
text-align: center; | |
background: rgba( 0, 0, 0, 0.05 ); |
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 Dashboard from './components/Dashboard'; | |
import AppNotices from './components/AppNotices'; | |
import '@wordpress/notices'; | |
function App() { | |
// ... | |
return ( | |
<div className="App container"> |
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
/** | |
* Showing the general Profile view | |
*/ | |
function Profile( { user }) { | |
return <div className="jumbotron"> | |
Welcome { user.nickname } | |
<p>I think your name is { user.first_name } { user.last_name}</p> | |
</div>; | |
} |
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 '~bootstrap/scss/bootstrap.scss'; |
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 | |
// ... | |
class WC_Product_Type_Plugin { | |
/** | |
* Build the instance | |
*/ | |
public function __construct() { |
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 MyFormTokenField from './components/FormTokenField'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> |
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 { Button, Modal } from '@wordpress/components'; | |
import { withState } from '@wordpress/compose'; | |
const MyModal = withState( { | |
isOpen: false, | |
} )( ( { isOpen, setState } ) => ( | |
<div> | |
<Button isDefault onClick={ () => setState( { isOpen: true } ) }>Open Modal</Button> | |
{ isOpen && ( | |
<Modal |