-
Notifications
You must be signed in to change notification settings - Fork 30
Added an 'npr_image_crop_url' hook. #40
base: master
Are you sure you want to change the base?
Changes from 4 commits
fb44ebf
ac9b27d
4734f8b
90b56df
f1819ee
2cae51a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ public static function nprstory_cron_pull() { | |
if ( $pub_option == 'Publish' ) { | ||
$pub_flag = TRUE; | ||
} | ||
$story = $api->update_posts_from_stories($pub_flag); | ||
$story = $api->update_posts_from_stories($pub_flag, "query_number={$i}" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The second argument for |
||
} else { | ||
if ( empty($story) ) { | ||
error_log('NPR Story API: not going to save story. Query '. $query_string .' returned an error '.$api->message->id. ' error'); // debug use | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,8 @@ function nprstory_settings_init() { | |
|
||
add_settings_section( 'ds_npr_api_get_multi_settings', 'NPR API multiple get settings', 'nprstory_api_get_multi_settings_callback', 'ds_npr_api_get_multi_settings' ); | ||
|
||
add_settings_field( 'ds_npr_num', 'Number of things to get', 'nprstory_api_num_multi_callback', 'ds_npr_api_get_multi_settings', 'ds_npr_api_get_multi_settings' ); | ||
|
||
add_settings_field( 'ds_npr_num', 'Number of things to get', 'nprstory_api_num_multi_callback', 'ds_npr_api_get_multi_settings', 'ds_npr_api_get_multi_settings' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove this from your patch to prevent the conflict from #39? |
||
register_setting( 'ds_npr_api_get_multi_settings', 'ds_npr_num', 'intval' ); | ||
|
||
|
@@ -72,6 +74,10 @@ function nprstory_settings_init() { | |
//ds_npr_query_publish_ | ||
add_settings_field( 'ds_npr_query_publish_' . $i, 'Publish Stories ' . $i, 'nprstory_api_query_publish_callback', 'ds_npr_api_get_multi_settings', 'ds_npr_api_get_multi_settings', $i ); | ||
register_setting( 'ds_npr_api_get_multi_settings', 'ds_npr_query_publish_' . $i , 'nprstory_validation_callback_select'); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove this from your patch to prevent the conflict from #39? |
||
// Add tags | ||
add_settings_field( 'ds_npr_query_tags_' . $i, 'Add Tags ' . $i, 'ds_npr_api_query_tags_callback', 'ds_npr_api_get_multi_settings', 'ds_npr_api_get_multi_settings', $i ); | ||
register_setting( 'ds_npr_api_get_multi_settings', 'ds_npr_query_tags_' . $i ); | ||
} | ||
|
||
add_settings_field( 'dp_npr_query_run_multi', 'Run the queries on saving changes', 'nprstory_query_run_multi_callback', 'ds_npr_api_get_multi_settings', 'ds_npr_api_get_multi_settings' ); | ||
|
@@ -170,6 +176,15 @@ function nprstory_api_query_callback( $i ) { | |
|
||
} | ||
|
||
function ds_npr_api_query_tags_callback( $i ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove this from your patch to prevent the conflict from #39? |
||
$name = 'ds_npr_query_tags_' . $i; | ||
$option = get_option( $name ); | ||
|
||
echo "<input type='text' value='$option' name='$name' style='width: 300px;' /> <p> Add tag(s) to each story pulled from NPR (comma separated).</p>"; | ||
wp_nonce_field( 'nprstory_nonce_ds_npr_tags_' . $i, 'nprstory_nonce_ds_npr_tags_' . $i . '_name', true, true ); | ||
echo "<p><hr></p>"; | ||
} | ||
|
||
function nprstory_api_num_multi_callback() { | ||
$option = get_option('ds_npr_num'); | ||
echo "<input type='number' value='$option' name='ds_npr_num' /> <p> Increase the number of queries by changing the number in the field above."; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could, resubmit your PR with the most recent
master
branch, which has the$qnum
parameter added to this function instead of an$opts
array or WP arg stringThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will be happy to remove my last changeset if that's what you would prefer.
But before I do may I ask to make sure you were aware they were based on the suggestions I made to PR #39? I added comments inline to the changeset but I don't see the comments I added: https://github.com/nprds/nprapi-wordpress/pull/39/files
I basically suggested that you future proof and not add a numeric 2nd parameter to
update_posts_from_stories()
but instead add an $opts array that would contain thequery_number
so that in future if you need to add other parameters you would have end up with a list of many ordinal parameters.But of course, feel free to decline this modification if you feel it is unimportant in which case I will revert that last commit from my PR.