Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
- Make sure your
Local by FlyWheelWordPress install is a custom install
Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
Local by FlyWheel WordPress install is a custom install| <!-- // The HTML (could be part of page content) // --> | |
| <input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input> | |
| <div id="datafetch">Search results will appear here</div> |
| <?php | |
| $filesystem = \Drupal::service('file_system'); | |
| // Create file entity. | |
| $image = File::create(); | |
| $image->setFileUri($destination); | |
| $image->setOwnerId(\Drupal::currentUser()->id()); | |
| $image->setMimeType('image/' . pathinfo($destination, PATHINFO_EXTENSION)); | |
| $image->setFileName($filesystem->basename($destination)); | |
| $image->setPermanent(); | |
| $image->save(); |
| // Paste in console | |
| var getThings = function(){ | |
| var divs = [...document.querySelectorAll("#manufacture__container > div")] | |
| var things = divs.map(function(e){ | |
| var result = {e}; | |
| var spans = [...e.getElementsByTagName("span")] | |
| spans.map(function(s){ | |
| var str = s.innerText.replace(/[^/.0-9]/g, ''); | |
| var a = str.split("/"); | |
| var num = +a[0]; |
This script helps you to test OAuth-signed requests against Drupal 8.
First, make sure that Drupal has been configured by following the steps at https://www.drupal.org/node/2110825. Then install this script with these steps:
consumer_key and consumer_secret. Then Adjust base_uri.php oauth_request.php.| body.loading:after { | |
| /* with no content, nothing is rendered */ | |
| content: ""; | |
| position: fixed; | |
| /* element stretched to cover during rotation an aspect ratio up to 1/10 */ | |
| top: -500%; | |
| left: -500%; | |
| right: -500%; | |
| bottom: -500%; | |
| z-index: 9999; |
| <?php | |
| /* From https://www.usps.com/send/official-abbreviations.htm */ | |
| $us_state_abbrevs_names = array( | |
| 'AL'=>'ALABAMA', | |
| 'AK'=>'ALASKA', | |
| 'AS'=>'AMERICAN SAMOA', | |
| 'AZ'=>'ARIZONA', | |
| 'AR'=>'ARKANSAS', |
| <? | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |