Skip to content

Instantly share code, notes, and snippets.

function my_register_settings() {
register_setting( 'my_options', 'my_options' );
add_settings_section( 'my_general', 'General Settings', 'my_section_general', 'my_options' );
add_settings_field( 'myoptions', 'Options', 'my_field_recurrence', 'my_options', 'my_general' );
add_settings_field( 'search', 'Search', 'my_field_search', 'my_options', 'my_general' );
}
add_action( 'admin_init', 'my_register_settings' );
function my_section_general() {
comment_form(array(
'logged_in_as'=>'<p>your string here</p>',
'get_comment_author_link'=>'get_comment_author2
)
);
public function get_social_media_posts() {
global $pods;
$posts = Pods('socialmedia');
$params = array();
$posts->find($params);
if ($posts->fetch()):
return array(
public function get_pod_by_cat() {
global $json_api;
$cat = $json_api->query->cat;
$params = array(
'where' => 'taxonomy.category = ' . $cat . '' ,
);
$posts = pods( 'socialmedia', $params );
$posts->find($params);
if ($posts->fetch()):
public function get_pod_by_cat() {
global $json_api;
$cat = $json_api->query->cat;
$params = array(
'where' => 'social_media_platform.name = ' . $cat . '' ,
);
$posts = pods( 'socialmedia', $params );
$posts->find($params);
if ($posts->fetch()):
public function get_by_media() {
global $json_api;
$media = $json_api->query->media;
$params = array(
'where' => 'category.name = "' . pods_sanitize( $cat ) . '" AND t.publish_status=true',
);
$posts = pods( 'socialmedia', $params );
$posts->find($params);
if ($posts->fetch()):
public function get_by_creation_date() {
global $json_api;
$created = $json_api->query->created;
$params = array(
'where' => 't.created = ' . $created. '' ,
);
$posts = pods( 'socialmedia', $params );
$posts->find($params);
if ($posts->fetch()):
public function get_social_media_posts() {
global $pods;
$posts = Pods('socialmedia');
$params = array();
$posts->find($params);
if ($posts->fetch()):
return array(
public function get_by_media_type() {
global $json_api;
$media = $json_api->query->media;
if (!$media)
{
$json_api->error("Oops. You forgot to include 'media' var in your request");
}
$params = array(
'where' => 'social_media_platform.name = "' . pods_sanitize( $media ) . '" AND t.publish_status=true',
);
public function get_all_recent() {
global $json_api;
$args=array(
'post_type'=> array( 'post', 'imported_content' ),
'posts_per_page' => 9999
);
$wp_query = new WP_Query();
$wp_query->query($args);
return array(
"posts" => $wp_query