Changeset 2478216
- Timestamp:
- 02/20/2021 08:12:05 PM (5 years ago)
- Location:
- news-search-engine/trunk
- Files:
-
- 4 edited
-
includes/formElement.php (modified) (4 diffs)
-
news-search-engine.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
views/admin-form.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
news-search-engine/trunk/includes/formElement.php
r2280035 r2478216 2 2 3 3 if ( !function_exists( 'news_search_engine_country' ) ) { 4 function news_search_engine_country($country ){?>4 function news_search_engine_country($country = ''){?> 5 5 6 6 <select name="news-search-engine-country" data-placeholder="Choose a Country"> … … 76 76 77 77 if ( !function_exists( 'news_search_engine_language' ) ) { 78 function news_search_engine_language($language ){78 function news_search_engine_language($language = ''){ 79 79 ?> 80 80 <select name="news-search-engine-language" data-placeholder="Choose a Language"> … … 100 100 101 101 if ( !function_exists( 'news_search_engine_category' ) ) { 102 function news_search_engine_category($category ){102 function news_search_engine_category($category = ''){ 103 103 ?> 104 104 <select name="news-search-engine-category" data-placeholder="Choose a Category"> … … 117 117 118 118 if ( !function_exists( 'news_search_engine_sort_by' ) ) { 119 function news_search_engine_sort_by($sortBy ){119 function news_search_engine_sort_by($sortBy = ''){ 120 120 ?> 121 121 <select name="news-search-engine-sort-by" data-placeholder="Sort By"> -
news-search-engine/trunk/news-search-engine.php
r2447515 r2478216 4 4 * Plugin URI: https://github.com/webmarcello8080/news-search-engine 5 5 * Description: News Search Engine is a Wordpress plugin that create a new section on the Wordpress Dashboard and it gives the possibility to search news through Google news API. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Requires at least: 4.5.13 8 8 * Requires PHP: 7.0 -
news-search-engine/trunk/readme.txt
r2447515 r2478216 80 80 == Changelog == 81 81 82 = 1.0.3 = 83 * fisual bugs vixed 84 82 85 = 1.0.2 = 83 86 * cleaning code and speeding up Ajax calls -
news-search-engine/trunk/views/admin-form.php
r2302481 r2478216 1 1 <?php 2 2 3 if( current_user_can( 'edit_users' ) ){3 if( current_user_can( 'edit_users' ) ){ 4 4 ?> 5 5 <div class="wrap"> … … 17 17 <td class="news-search-engine-type" colspan="3"> 18 18 <lable> 19 <input type="radio" name="news-search-engine-type" value="sources" <?= sanitize_text_field($_POST['news-search-engine-type']) == 'sources' ? ' checked' : ''; ?> /> <b>Sources</b>19 <input type="radio" name="news-search-engine-type" value="sources" <?= $_POST ? sanitize_text_field($_POST['news-search-engine-type']) == 'sources' ? ' checked' : '' : ''; ?> /> <b>Sources</b> 20 20 <p class="description">This endpoint returns the subset of news publishers that top headlines are available from.</p> 21 21 </lable> 22 22 <lable> 23 <input type="radio" name="news-search-engine-type" value="everything" <?= sanitize_text_field($_POST['news-search-engine-type']) == 'everything' ? ' checked' : ''; ?> /> <b>Everything</b>23 <input type="radio" name="news-search-engine-type" value="everything" <?= $_POST ? sanitize_text_field($_POST['news-search-engine-type']) == 'everything' ? ' checked' : '' : ''; ?> /> <b>Everything</b> 24 24 <p class="description">Search through articles.</p> 25 25 </lable> 26 26 <lable> 27 <input type="radio" name="news-search-engine-type" value="topHeadlines" <?= sanitize_text_field($_POST['news-search-engine-type']) == 'topHeadlines' ? ' checked' : ''; ?> /> <b>Top Headlines</b>27 <input type="radio" name="news-search-engine-type" value="topHeadlines" <?= $_POST ? sanitize_text_field($_POST['news-search-engine-type']) == 'topHeadlines' ? ' checked' : '' : ''; ?> /> <b>Top Headlines</b> 28 28 <p class="description">This endpoint provides live top and breaking headlines.</p> 29 29 </lable> … … 37 37 </th> 38 38 <td class="sources topHeadlines"> 39 <?= news_search_engine_category( esc_html( $_POST['news-search-engine-category'] )); ?>39 <?= news_search_engine_category($_POST ? esc_html( $_POST['news-search-engine-category'] ) : ''); ?> 40 40 <p class="description">Find sources that display news of this category.</p> 41 41 </td> … … 46 46 </th> 47 47 <td class="everything"> 48 <?= news_search_engine_sort_by( esc_html( $_POST['news-search-engine-sort-by'] )); ?>48 <?= news_search_engine_sort_by( $_POST ? esc_html( $_POST['news-search-engine-sort-by'] ) : ''); ?> 49 49 <p class="description">The order to sort the articles in.</p> 50 50 </td> … … 57 57 </th> 58 58 <td class="sources topHeadlines everything"> 59 <?= news_search_engine_language( esc_html( $_POST['news-search-engine-language'] )); ?>59 <?= news_search_engine_language( $_POST ? esc_html( $_POST['news-search-engine-language'] ) : ''); ?> 60 60 <p class="description">Find sources that display news in a specific language.</p> 61 61 </td> … … 66 66 </th> 67 67 <td class="sources topHeadlines"> 68 <?= news_search_engine_country( esc_html( $_POST['news-search-engine-country'] )); ?>68 <?= news_search_engine_country( $_POST ? esc_html( $_POST['news-search-engine-country'] ) : ''); ?> 69 69 <p class="description">Note: you can't mix this param with the sources param.</p> 70 70 </td> … … 77 77 </th> 78 78 <td class="topHeadlines everything"> 79 <input type="text" name="news-search-engine-q" value="<?= esc_html($_POST['news-search-engine-q'])?>" />79 <input type="text" name="news-search-engine-q" value="<?= $_POST ? esc_html($_POST['news-search-engine-q']) : '' ?>" /> 80 80 <p class="description">Keywords or a phrase to search for.</p> 81 81 </td> … … 86 86 </th> 87 87 <td class="everything"> 88 <input type="text" name="news-search-engine-qIn-title" value="<?= esc_html($_POST['news-search-engine-qIn-title'])?>" />88 <input type="text" name="news-search-engine-qIn-title" value="<?= $_POST ? esc_html($_POST['news-search-engine-qIn-title']) : '' ?>" /> 89 89 <p class="description">Keywords or phrases to search for in the article title only.</p> 90 90 </td> … … 97 97 </th> 98 98 <td class="everything"> 99 <input type="date" name="news-search-engine-from" value="<?= esc_html($_POST['news-search-engine-from'])?>" />99 <input type="date" name="news-search-engine-from" value="<?= $_POST ? esc_html($_POST['news-search-engine-from']) : '' ?>" /> 100 100 <p class="description">A date and optional time for the oldest article allowed.</p> 101 101 </td> … … 106 106 </th> 107 107 <td class="everything"> 108 <input type="date" name="news-search-engine-to" value="<?= esc_html($_POST['news-search-engine-to'])?>" />108 <input type="date" name="news-search-engine-to" value="<?= $_POST ? esc_html($_POST['news-search-engine-to']) : '' ?>" /> 109 109 <p class="description">A date and optional time for the newest article allowed.</p> 110 110 </td> … … 118 118 </th> 119 119 <td class="topHeadlines everything"> 120 <input type="text" name="news-search-engine-sources" value="<?= esc_html($_POST['news-search-engine-sources'])?>" autocomplete="off" />120 <input type="text" name="news-search-engine-sources" value="<?= $_POST ? esc_html($_POST['news-search-engine-sources']) : '' ?>" autocomplete="off" /> 121 121 <div id="source-suggesstion-box"></div> 122 122 <p class="description">A comma-seperated string of identifiers for the news sources or blogs you want headlines from.</p> … … 128 128 </th> 129 129 <td class="everything"> 130 <input type="text" name="news-search-engine-domains" value="<?= esc_html($_POST['news-search-engine-domains'])?>" autocomplete="off" />130 <input type="text" name="news-search-engine-domains" value="<?= $_POST ? esc_html($_POST['news-search-engine-domains']) : '' ?>" autocomplete="off" /> 131 131 <div id="domain-suggesstion-box"></div> 132 132 <p class="description">A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.</p>
Note: See TracChangeset
for help on using the changeset viewer.