Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Anderson Oceas

View GitHub Profile
View register-sermons.php
<?php
class Books {
/**
* Permalink slug for this post type
*
* @var string $slug Permalink prefix
* @since NEXT
*/
View file-upload.php
/**
* Upload photo to site.
*
* @author Scott Anderson <scott.anderson@webdevstudios.com>
* @since NEXT
* @param Request $request Request form date to format for api.
* @return int Id of image uploaded.
*/
public function upload_photo( Request $request ) : int {
$this->new_construct();
@Oceas
Oceas / embed
Created Nov 27, 2019
embed test
View embed
embed test
@Oceas
Oceas / app.js
Last active Sep 19, 2019
WDS Headless WordPress Example
View app.js
import React from 'react';
import {StyleSheet, ScrollView, View, Text, Image, Button} from 'react-native';
import axios from 'axios';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import {WebView} from 'react-native-webview';
export default class App extends React.Component {
constructor(props) {
@Oceas
Oceas / wds-hello-world.php
Last active Aug 3, 2021
WDS WP-CLI 101 Complete
View wds-hello-world.php
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/
class WDS_CLI {
@Oceas
Oceas / gist:fc9b863cce38c8d40fc863b50967fc8b
Last active Sep 16, 2019
WDS WP-CLI 101 Putting It Together
View gist:fc9b863cce38c8d40fc863b50967fc8b
/**
* Generate posts with meta values.
*
* @param Array $args Arguments in array format.
* @param Array $assoc_args Key value arguments stored in associated array format.
* @since 1.0.0
* @author Scott Anderson
*/
public function generate_posts( $args, $assoc_args ) {
View gist:76ee6e7dbf1bec56c1833bdf0d218591
/**
* Displays progress bar to demonstrate progression through a time consuming process.
*
* @param Array $args Arguments in array format.
* @param Array $assoc_args Key value arguments stored in associated array format.
* @since 1.0.0
* @author Scott Anderson
*/
public function generate_posts_progress_bar( $args, $assoc_args ) {
@Oceas
Oceas / wds-hello-world.php
Last active Sep 16, 2019
WP-CLI 101 Messages
View wds-hello-world.php
/**
* Returns multiple messages to demonstrate different command return types.
*
* @since 1.0.0
* @author Scott Anderson
*/
public function display_messages( $args, $assoc_args ) {
// No prepends.
WP_CLI::line( 'Standard line return.' ); // No prefix on line return.
@Oceas
Oceas / wds-hello-world.php
Last active Sep 19, 2019
WP-CLI 101 Function with Arguments
View wds-hello-world.php
/**
* Returns all arguments passed into command to demonstrate how to access them.
*
* @param Array $args Arguments in array format.
* @param Array $assoc_args Key value arguments stored in associated array format.
* @since 1.0.0
* @author Scott Anderson
*/
public function display_arguments( $args, $assoc_args ) {
View wds-hello-world.php
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/