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
| /** | |
| * Returns articles for the current page. | |
| * @param {integer} page | |
| * @param {array} articles | |
| * @param {object} articlesPages | |
| */ | |
| function getArticlesForPage( page = 1, articles, articlesPages ) { | |
| // If we don't have them, return empty array | |
| if ( ! articlesPages[ page ] ) { | |
| return []; |
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: Show the correct payment method in WooCommerce Subscription | |
| * Description: Change the list of available payment methods to show the currently selected one instead of the default one. | |
| * Version: 1.0.0 | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| return; | |
| } |
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
| /** | |
| * 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 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 | |
| /** | |
| * 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 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 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 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
| // ... | |
| .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 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 Dashboard from './components/Dashboard'; | |
| import AppNotices from './components/AppNotices'; | |
| import '@wordpress/notices'; | |
| function App() { | |
| // ... | |
| return ( | |
| <div className="App container"> |
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
| /** | |
| * 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 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 '~bootstrap/scss/bootstrap.scss'; |
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 | |
| // ... | |
| class WC_Product_Type_Plugin { | |
| /** | |
| * Build the instance | |
| */ | |
| public function __construct() { |