Create a file in the Home directory. touch ~/git-prompt.sh
Copy these codes into the file. Link here
put below codes in ~/.zshrc file
# auto complete on pressing TABCreate a file in the Home directory. touch ~/git-prompt.sh
Copy these codes into the file. Link here
put below codes in ~/.zshrc file
# auto complete on pressing TAB| name: Deploy to WordPress.org | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| tag: | |
| name: New tag | |
| runs-on: ubuntu-latest |
| <?php | |
| abstract class Facade { | |
| abstract protected static function getInstance(); | |
| public static function __callStatic($method, $arguments) { | |
| $instance = static::getInstance(); |
| // php file | |
| function enqueue_scripts() { | |
| wp_enqueue_script( 'public-js', plugin_dir_url( __FILE__ ) . 'js/script.js', array(), '1.0', true ); | |
| wp_localize_script( 'public-js', 'localizeObj', | |
| [ | |
| 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 'nonce' => wp_create_nonce( 'prefix_public_nonce' ), | |
| ] | |
| ); | |
| } |
| exports.createPages = async ({ graphql, actions }) => { | |
| const { createPage } = actions | |
| const wpData = await graphql(` | |
| { | |
| allWordpressPost { | |
| nodes { | |
| wordpress_id | |
| slug | |
| title |
| <?php | |
| $facebook_feed = get_transient( '_facebook_cash' ); | |
| $url_queries = 'fields=status_type,created_time,from,message,story,full_picture,permalink_url,attachments.limit(1){type,media_type,title,description,unshimmed_url},comments.summary(total_count),reactions.summary(total_count)'; | |
| $page_id = 'your facebook page id'; | |
| $token = 'your access token'; | |
| $url = 'https://graph.facebook.com/v4.0/' . $page_id . '/posts?' . $url_queries . '&access_token=' . $token; | |
| if ( false === $facebook_feed ) { | |
| $fb_posts = wp_remote_get( $url ); |
| Create SSH key: ssh-keygen -t rsa -C "your_email@example.com" | |
| Ubuntu Copy SSH: xclip -sel clip < ~/.ssh/id_rs.pub | |
| Windows Copy SSH: clip < ~/.ssh/id_rsa.pub |
| <?php | |
| // classes/greatings.php | |
| namespace Classes; | |
| class Greatings { | |
| function hello() { | |
| return "Successfully called Greatings"; | |
| } |
| // function.php wp_enqueue_scripts | |
| wp_localize_script( 'main-js', 'rootUrl', array( | |
| 'siteUrl' => get_site_url() | |
| ) ); | |
| // main.js | |
| var ourRequest = new XMLHttpRequest(); | |
| ourRequest.open('GET', rootUrl.siteUrl + '/wp-json/wp/v2/posts'); | |
| ourRequest.onload = function() { |
| <div class="row"> | |
| <div class="col-md-8 comment-form"> | |
| <?php | |
| $fields = array( | |
| 'author' => | |
| '<div class="form-group"><label for="author">' . __( 'Name', 'domainreference' ) . '</label> <span class="required">*</span> <input id="author" name="author" type="text" class="form-control" value="' . esc_attr( $commenter['comment_author'] ) . '" required="required" /></div>', | |
| 'email' => | |
| '<div class="form-group"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> <span class="required">*</span><input id="email" name="email" class="form-control" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" required="required" /></div>', |