Skip to content

Commit

Permalink
going through some of the php files to work on function reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rnagle committed May 18, 2015
1 parent 61a26f4 commit b47c2fa
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 28 deletions.
10 changes: 3 additions & 7 deletions docs/api/feed-mailchimp.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
feed-mailchimp.php
==================

.. php:attr:: $numposts
.. php:function:: rss_date()
Template Name: MailChimp Feed
A feed with thumbnail images for MailChimp import
Feed address to use for MailChimp import will be http://myurl.com/?feed=mailchimp
A template tag for printing the date in a format suitable for an RSS feed

:package: Largo
:since: 0.2
:param mixed $timestamp: (optional) the unix timestamp for which to print the formatted date
2 changes: 0 additions & 2 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Function reference by file

* `feed-mailchimp.php <feed-mailchimp.html>`_
* `functions.php <functions.html>`_
* `image.php <image.html>`_
* `largo-apis.php <largo-apis.html>`_
* `options.php <options.html>`_
* `homepages/homepage.php <homepages/homepage.html>`_
* `homepages/layouts/HomepageSingleWithSeriesStories.php <homepages/layouts/HomepageSingleWithSeriesStories.html>`_
Expand Down
11 changes: 10 additions & 1 deletion docs/api/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ options.php

If you are making your theme translatable, you should replace 'options_framework_theme'
with the actual text domain for your theme. Read more:
http://codex.wordpress.org/Function_Reference/load_theme_textdomain
http://codex.wordpress.org/Function_Reference/load_theme_textdomain

.. php:function:: optionsframework_custom_scripts()
This function prints Javascript on the Theme Options admin page to control the behavior
of certain options that depend or require other options.

For example, you can not use Custom Landing Pages unless Series taxonomy is enabled. So,
this script will hide the Custom Landing Pages option until the Series taxonomy checkbox
is enabled.
25 changes: 16 additions & 9 deletions feed-mailchimp.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<?php
/**
* Template Name: MailChimp Feed
* A feed with thumbnail images for MailChimp import
* Feed address to use for MailChimp import will be http://myurl.com/?feed=mailchimp
*
* A feed with thumbnail images for MailChimp import.
* Feed address to use for MailChimp import will be http://myurl.com/?feed=mailchimp.
*
* @package Largo
* @since 0.2
*/

/**
* @ignore
*/
$numposts = 20;
$posts = query_posts( array(
'showposts' => $numposts
) );
$lastpost = $numposts - 1;

/**
* A template tag for printing the date in a format suitable for an RSS feed
*
* @param mixed $timestamp (optional) the unix timestamp for which to print the formatted date
*/
function rss_date( $timestamp = null ) {
$timestamp = ($timestamp==null) ? time() : $timestamp;
echo date(DATE_RSS, $timestamp);
}

$posts = query_posts( array(
'showposts' => $numposts
) );

$lastpost = $numposts - 1;

header("Content-Type: application/rss+xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
Expand Down Expand Up @@ -48,4 +55,4 @@ function rss_date( $timestamp = null ) {
</item>
<?php } // foreach ?>
</channel>
</rss>
</rss>
4 changes: 3 additions & 1 deletion image.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
/**
* The template for displaying image attachments.
*
* @package Largo
*/

get_header(); ?>
Expand Down Expand Up @@ -37,7 +39,7 @@
<div class="entry-attachment">
<div class="attachment">
<?php
/**
/*
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
*/
Expand Down
10 changes: 7 additions & 3 deletions largo-apis.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<?php

/**
* This file acts as a wrapper around APIs that exist within Largo.
* It should be included in any Largo child themes like so:
* require_once( get_template_directory() . '/largo-apis.php' );
*
* @package Largo
*/

/**
* @ignore
*/
$includes = array(
'/inc/metabox-api.php', // library-esque convenience functions for hooking into Largo meta boxen
'/inc/metabox-api.php', // library-esque convenience functions for hooking into Largo meta boxen
);

// Perform load
foreach ( $includes as $include ) {
include_once( get_template_directory() . $include );
}
}
23 changes: 18 additions & 5 deletions options.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
/**
* Largo's Options Framework configuration file
*
* Defines all of the default options and available values for Largo.
*
* @package Largo
*/

//=//

/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*/

function optionsframework_option_name() {

// This gets the theme name from the stylesheet
$themename = get_option( 'stylesheet' );
$themename = preg_replace("/\W/", "_", strtolower($themename) );
Expand All @@ -24,9 +32,7 @@ function optionsframework_option_name() {
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/

function optionsframework_options() {

$imagepath = get_template_directory_uri() . '/lib/options-framework/images/';
$home_templates = array();
$home_templates_data = largo_get_home_layouts();
Expand Down Expand Up @@ -652,9 +658,16 @@ function optionsframework_options() {
* This is an example of how to add custom scripts to the options panel.
* This example shows/hides an option when a checkbox is clicked.
*/

add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');

/**
* This function prints Javascript on the Theme Options admin page to control the behavior
* of certain options that depend or require other options.
*
* For example, you can not use Custom Landing Pages unless Series taxonomy is enabled. So,
* this script will hide the Custom Landing Pages option until the Series taxonomy checkbox
* is enabled.
*/
function optionsframework_custom_scripts() { ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
Expand Down

0 comments on commit b47c2fa

Please sign in to comment.