Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Category Metadata
*
* @package BE_Genesis_Child
* @since 1.0.0
* @link https://github.com/billerickson/BE-Genesis-Child
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
/**
* Register Category Sponsor Options
*
*/
function be_register_sponsor_options() {
add_action( 'category_edit_form', 'be_sponsor_options', 10, 2 );
}
add_action( 'admin_init', 'be_register_sponsor_options' );
/**
* Category Sponsor Options
*
*/
function be_sponsor_options( $tag, $taxonomy ) {
$tax = get_taxonomy( $taxonomy );
?>
<h3><?php echo esc_html( $tax->labels->singular_name );?> Sponsor Settings</h3>
<table class="form-table">
<tbody>
<tr>
<th scope="row" valign="top"><label for="meta[sponsor_text]">Sponsor Text</label></th>
<td>
<input id="meta[sponsor_text]" name="meta[sponsor_text]" type="text" value="<?php echo esc_attr( $tag->meta['sponsor_text'] ); ?>" size="40" />
<p class="description"></p>
</td>
</tr>
<tr>
<th scope="row" valign="top"><label for="meta[sponsor_url]">Sponsor URL</label></th>
<td>
<input id="meta[sponsor_url]" name="meta[sponsor_url]" type="text" value="<?php echo esc_url( $tag->meta['sponsor_url'] ); ?>" size="40" />
<p class="description"></p>
</td>
</tr>
</tbody>
</table>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment