** Tested with Laravel 7.x and WordPress 5.5
- Download the sql table "wp_users" from WordPress, and upload it to the laravel mysql table.
- Create the migration:
const urlRequest = 'http://wp.loc/wp-json/wp/v2/posts?_fields=title'; | |
async function getPostsFromWp() { | |
try { | |
const response = await fetch( urlRequest ) | |
const data = await response.json() | |
return data | |
} catch ( e ) { | |
console.error( e ) | |
} |
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } /> |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
</body> | |
</html> |
To make Postman work with POST/PUT requests... | |
https://laravel.com/docs/5.2/routing#csrf-x-csrf-token | |
In addition to checking for the CSRF token as a POST parameter, the Laravel VerifyCsrfToken middleware will also check for the X-CSRF-TOKEN request header. | |
1. Store the token in a "meta" tag at the top of your root view file (layouts/app.blade.php)... | |
<meta name="csrf-token" content="{{ csrf_token() }}"> | |
** If using jQuery, you can now instruct it to include the token in all request headers. | |
$.ajaxSetup({ |
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
gulp.task('less', function() { | |
return gulp.src('./style.less') // only compile the entry file | |
.pipe(less()) | |
.pipe(gulp.dest('./build')) | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('./*.less', ['less']); // Watch all the .less files, then run the less task |
<?php | |
/** | |
* Plugin Name: WooCommerce Settings Tab Demo | |
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a | |
* Description: A plugin demonstrating how to add a WooCommerce settings tab. | |
* Author: Patrick Rauland | |
* Author URI: http://speakinginbytes.com/ | |
* Version: 1.0 | |
* | |
* This program is free software: you can redistribute it and/or modify |
##Create an alias to MAMP's PHP installation
To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.
Within the terminal, run:
nano ~/.bash_profile
This will open nano with the contents, at the top in a blank line add the following line:
// Get the database object | |
$db = JFactory::getDbo(); | |
// JTableCategory is autoloaded in J! 3.0, so... | |
if (version_compare(JVERSION, '3.0', 'lt')) | |
{ | |
JTable::addIncludePath(JPATH_PLATFORM . 'joomla/database/table'); | |
} | |
// Initialize a new category |