curl -LO https://deployer.org/deployer.phar && sudo mv deployer.phar /usr/local/bin/dep && sudo chmod +x /usr/local/bin/dep
composer require deployer/recipes --dev
composer require rafaelstz/deployer-magento2 dev-master --dev
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 | |
| // Standard API query arguments | |
| $args = array( | |
| 'orderby' => 'title', | |
| 'per_page' => 3 | |
| ); | |
| // Put into the `add_query_arg();` to build a URL for use | |
| // Just an alternative to manually typing the query string | |
| $url = add_query_arg( $args, rest_url('wp/v2/posts') ); |
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
| // This function implements a "Load More" button. | |
| // It assumes that there is already a matching query that has executed on the page, so this AJAX call is just a continuation of that query to grab additional posts. | |
| // There are no animations added here. For a smoother experience, it is a good idea to add animations to the button (ex. a loading icon during the request), or making the new posts animate in (ex, using Animate.css to fade them into the page) | |
| $(function() { | |
| // Grab the load more button, since I only want to run the code if the button is on the page | |
| var loadMoreButton = $('#load-more'); | |
| if (loadMoreButton) { | |
| // Because there are already posts on the page, we need to manually tell this query what page of results to grab so that is doesn't load duplicate posts | |
| var loadPosts = function(page) { |
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
| git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin" |
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 | |
| add_filter( 'the_content', 'remove_empty_p', 20, 1 ); | |
| function remove_empty_p( $content ){ | |
| // clean up p tags around block elements | |
| $content = preg_replace( array( | |
| '#<p>\s*<(div|aside|section|article|header|footer)#', | |
| '#</(div|aside|section|article|header|footer)>\s*</p>#', | |
| '#</(div|aside|section|article|header|footer)>\s*<br ?/?>#', | |
| '#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#', | |
| '#<p>\s*</(div|aside|section|article|header|footer)#', |