$query = new WP_Query( array( ‘meta_key’ => ‘quote’, ‘meta_value’ => ”, ‘meta_compare’ => ‘!=’ ) );
Author: Barrett
-
wptexturize()
Function Reference: wptexturize(): converts quotes, dashes, elipsis, etc. from text to rich-text (smart-quotes, en/em-dash, etc.).
Combine w/ wpautop to process text that WP does not by default:
echo wpautop( wptexturize ( $custom_field_text ) );
-
wp_title()
Function Reference:
wp_title(): Retrieves the Title of a post or Page, the Archive (“2012”, “2006 – January”, etc.), or the Category or Author, depending on the query.<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title> -
Quotes
A List Apart: Articles: Understanding Web Design
Understanding Web Design
by JEFFREY ZELDMAN, 2007In 1994, the web was weird and wild, they told us. In ‘99 it was a kingmaker; in ‘01, a bust. In ‘02, news folk discovered blogs; in ‘04, perspiring guest bloggers on CNN explained how citizen journalists were reinventing news and democracy and would determine who won that year’s presidential election. I forget how that one turned out.
When absurd predictions die ridiculous deaths, nobody resigns from the newsroom, they just throw a new line into the water—like marketers replacing a slogan that tanked. After decades of news commoditization, what’s amazing is how many good reporters there still are, and how hard many try to lay accurate information before the public. Sometimes you can almost hear it beneath the roar of the grotesque and the exceptional.
-
Include Files
<?php $included_files = get_included_files(); echo "<!-- \n"; print_r($included_files); echo "\n-->"; ?>
-
Memory
http://us2.php.net/manual/en/function.memory-get-usage.php
http://us2.php.net/manual/en/function.memory-get-peak-usage.phpP3 (Plugin Performance Profiler)
http://bradshawenterprises.com/tests/formdemo.php
-
FOUC
<script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script> -
Window
$('aXXX').click(function(ev){ window.open('/plans/individual/continue-to-ap-pop.asp', 'Continue_to_Application','width=200,height=400'); ev.preventDefault(); return false; }) var $url = ''; jquery('new_win').click(function(ev){ $url = jquery(this).attr( 'href' )' window.open($url, 'media_win','width=650,height=700'); ev.preventDefault(); return false; }) -
RJI
This is the first survey of how information moves through a journalistic operations, large and small. At your organization, for instance, when a story moves from research to writing to editing to publication, what is saved?
- Are you able to enter/upload research notes, source locations (URLs and addresses), and interview transcripts, with links permanently associating it with the story?
- Can you indicate source material original to the story, such as interviews you collected, to preserve its provenance?
- During editing, is it easy to track revisions and display differences in versions?
- After publication, how does the story update and evolve on the web, and how do your site visitors know what’s been changed?
In surveying a representative sample of media outlets, we’ll find solutions at one that others may want to adopt. And we’ll reveal system-wide needs — some that can be solved with simple tools. But these “research/storytelling resources” are byproducts of this project. The larger goal is to document the way we journalists work with information, and how programmers might help us do our work.
This project gives journalists conceptual handles to evaluate how their info flows, to imagine improved processes, with smoother flows and less lost info, and to communicate their insights with programmers. For example, here’s an interactive “mind map” (link and screenshot) that can help stimulate that conversation:
-
Users
Adding and using custom user profile fields
Function Reference/update user meta « WordPress Codex
<?php /* =USER Extra Fields (Pilot check dates) */ // the_author_meta( $meta_key, $user_id ); add_action( 'show_user_profile', 'nwa_show_extra_profile_fields' ); add_action( 'edit_user_profile', 'nwa_show_extra_profile_fields' ); function nwa_show_extra_profile_fields( $user ) { ?> <h3>Pilot Checks</h3> <table class="form-table"> <tr> <td> <span class="description">Dates when last done:</span> </td> <th><label for="pilot_checkride">135 Checkride</label></th> <td> <input type="text" name="pilot_checkride" id="pilot_checkride" value="<?php echo esc_attr( get_the_author_meta( 'pilot_checkride', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="pilot_med">Class 2 Medical</label></th> <td> <span class="description">Dates when last done:</span> <input type="text" name="pilot_med" id="pilot_med" value="<?php echo esc_attr( get_the_author_meta( 'pilot_med', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="pilot_osa">OSA</label></th> <td> <input type="text" name="pilot_osa" id="pilot_checkride" value="<?php echo esc_attr( get_the_author_meta( 'pilot_osa', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> </table> <?php } add_action( 'personal_options_update', 'nwa_save_extra_profile_fields' ); add_action( 'edit_user_profile_update', 'nwa_save_extra_profile_fields' ); function nwa_save_extra_profile_fields( $user_id ) { if ( !current_user_can( 'edit_user', $user_id ) ) return false; /* Copy and paste this line for additional fields. Make sure to change to the field ID. */ update_user_meta( $user_id, 'pilot_checkride', $_POST['pilot_checkride'] ); update_user_meta( $user_id, 'pilot_med', $_POST['pilot_med'] ); update_user_meta( $user_id, 'pilot_osa', $_POST['pilot_osa'] ); } ?>