This file contains 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 | |
$alpha_title_text = 'card-title'; | |
$alpha_content_text = 'card-text'; | |
$alpha_meta_wrap = 'card-footer text-muted'; | |
if ( !is_active_sidebar( 'sidebar-1' ) ) { | |
$alpha_title_text = 'text-center'; | |
$alpha_content_text = 'text-center'; | |
$alpha_meta_wrap = 'text-center'; |
This file contains 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
<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>', |
This file contains 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
// 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() { |
This file contains 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 | |
// classes/greatings.php | |
namespace Classes; | |
class Greatings { | |
function hello() { | |
return "Successfully called Greatings"; | |
} |
This file contains 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
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 |
This file contains 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 | |
$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 ); |
This file contains 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
exports.createPages = async ({ graphql, actions }) => { | |
const { createPage } = actions | |
const wpData = await graphql(` | |
{ | |
allWordpressPost { | |
nodes { | |
wordpress_id | |
slug | |
title |
This file contains 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 | |
abstract class Facade { | |
abstract protected static function getInstance(); | |
public static function __callStatic($method, $arguments) { | |
$instance = static::getInstance(); |
This file contains 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
name: Deploy to WordPress.org | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
tag: | |
name: New tag | |
runs-on: ubuntu-latest |
This file contains 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 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' ), | |
] | |
); | |
} |
OlderNewer