Basic tips commands to Apache for PHP
sudo apt update
sudo apt install apache2| <?php | |
| /** | |
| * Plugin Name: Static Templates | |
| * | |
| * If most of your site content is in .php template files, and you're tired of | |
| * creating new pages, assigning them page templates, creating page templates | |
| * then doing it all over again on production, this plugin is for you. | |
| * | |
| * Examples: | |
| * |
| var debug = process.env.NODE_ENV !== "production"; | |
| var webpack = require('webpack'); | |
| module.exports = { | |
| context: __dirname, | |
| devtool: debug ? "inline-sourcemap" : null, | |
| entry: "./js/scripts.js", | |
| output: { | |
| path: __dirname + "/js", | |
| filename: "scripts.min.js" |
| 1. Go to Sublime Text to: Tools -> Build System -> New Build System | |
| and put the next lines: | |
| { | |
| "cmd": ["python3", "-i", "-u", "$file"], | |
| "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
| "selector": "source.python" | |
| } | |
| Then save it with a meaningful name like: python3.sublime-build |
| add_action( 'graphql_register_types', function() { | |
| register_graphql_field( 'Post', 'likeCount', [ | |
| 'type' => 'Int', | |
| 'description' => __( 'The number of likes for the post', 'your-textdomain' ), | |
| 'resolve' => function( $post ) { | |
| $likes = get_post_meta( $post->ID, 'likes', true ); | |
| return isset( $likes ) ? (int) $likes : 0; | |
| } | |
| ] ); |