Changeset 2871683
- Timestamp:
- 02/27/2023 12:40:31 PM (3 years ago)
- Location:
- display-medium-stories
- Files:
-
- 2 added
- 2 deleted
- 5 edited
-
assets/128x128.png (deleted)
-
assets/256x256.png (deleted)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
trunk/assets/js/script.js (modified) (1 diff)
-
trunk/includes/settings.php (modified) (8 diffs)
-
trunk/medium-post.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/views/shortcode.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
display-medium-stories/trunk/assets/js/script.js
r2832393 r2871683 26 26 output_cont_size.innerHTML = this.value; 27 27 } 28 29 var md_info = document.getElementById('md-info-tab'); 30 md_info.addEventListener('click', function() { 31 this.classList.add('active'); 32 document.getElementById('md-grid').classList.remove('show'); 33 document.getElementById('md-grid').classList.remove('active'); 34 document.getElementById('md-info').classList.add('show'); 35 document.getElementById('md-info').classList.add('active'); 36 document.getElementById('md-settings').classList.remove('show'); 37 document.getElementById('md-settings').classList.remove('active'); 38 document.getElementById('md-grid-tab').classList.remove('active'); 39 document.getElementById('md-settings-tab').classList.remove('active'); 40 }); 41 42 var md_grid = document.getElementById('md-grid-tab'); 43 md_grid.addEventListener('click', function() { 44 this.classList.add('active'); 45 document.getElementById('md-grid').classList.add('show'); 46 document.getElementById('md-grid').classList.add('active'); 47 document.getElementById('md-info').classList.remove('show'); 48 document.getElementById('md-info').classList.remove('active'); 49 document.getElementById('md-settings').classList.remove('show'); 50 document.getElementById('md-settings').classList.remove('active'); 51 document.getElementById('md-info-tab').classList.remove('active'); 52 document.getElementById('md-settings-tab').classList.remove('active'); 53 }); 54 55 var md_grid = document.getElementById('md-settings-tab'); 56 md_grid.addEventListener('click', function() { 57 this.classList.add('active'); 58 document.getElementById('md-grid').classList.remove('show'); 59 document.getElementById('md-grid').classList.remove('active'); 60 document.getElementById('md-info').classList.remove('show'); 61 document.getElementById('md-info').classList.remove('active'); 62 document.getElementById('md-settings').classList.add('show'); 63 document.getElementById('md-settings').classList.add('active'); 64 document.getElementById('md-info-tab').classList.remove('active'); 65 document.getElementById('md-grid-tab').classList.remove('active'); 66 }); -
display-medium-stories/trunk/includes/settings.php
r2832393 r2871683 33 33 $current_page = admin_url($_GET["page"]); 34 34 if (strstr($current_page, "medium-post")) { 35 wp_enqueue_style('bootstrap-toggle-min', MP_PLUGIN_DIR_URL . "assets/css/bootstrap-toggle.min.css");36 35 wp_enqueue_style('admin-bootstrap-style', MP_PLUGIN_DIR_URL . "assets/bootstrap/css/bootstrap.min.css"); 37 36 wp_enqueue_style('admin-style', MP_PLUGIN_DIR_URL . "assets/css/admin-style.css"); … … 49 48 wp_enqueue_script('admin-script', MP_PLUGIN_DIR_URL . "assets/js/script.js", array('jquery')); 50 49 wp_enqueue_script('admin-bootstrap-script', MP_PLUGIN_DIR_URL . "assets/bootstrap/js/bootstrap.min.js", array('jquery')); 51 wp_enqueue_script('jquery', MP_PLUGIN_DIR_URL . "assets/js/jquery.min.js");52 wp_enqueue_script('bootstrap-toggle-min', MP_PLUGIN_DIR_URL . "assets/js/bootstrap-toggle.min.js", array('jquery'));53 50 settings_fields('medium-post-settings-group'); 54 51 do_settings_sections('medium-post-settings-group'); … … 77 74 <div class="row m-0"> 78 75 <div class="col-md-12 p-0"> 79 <div class="nav flex-column nav-pills tab_Wrapper" id="v-pills-tab" role="tablist" aria-orientation="vertical">80 <a class="nav-link font-weight-bold active" id="md-info-tab" data-toggle="pill" href="#md-info" role="tab" aria-controls="md-info" aria-selected="true">76 <div class="nav flex-column nav-pills tab_Wrapper" > 77 <a class="nav-link font-weight-bold active" id="md-info-tab" href="javascript:void(0)"> 81 78 <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16"> 82 79 <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" /> … … 84 81 </svg>Information 85 82 </a> 86 <a class="nav-link font-weight-bold " id="md-grid-tab" data-toggle="pill" href="#md-grid" role="tab" aria-controls="md-grid" aria-selected="false">83 <a class="nav-link font-weight-bold " id="md-grid-tab" href="javascript:void(0)"> 87 84 <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-newspaper" viewBox="0 0 16 16"> 88 85 <path d="M0 2.5A1.5 1.5 0 0 1 1.5 1h11A1.5 1.5 0 0 1 14 2.5v10.528c0 .3-.05.654-.238.972h.738a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 1 1 0v9a1.5 1.5 0 0 1-1.5 1.5H1.497A1.497 1.497 0 0 1 0 13.5v-11zM12 14c.37 0 .654-.211.853-.441.092-.106.147-.279.147-.531V2.5a.5.5 0 0 0-.5-.5h-11a.5.5 0 0 0-.5.5v11c0 .278.223.5.497.5H12z" /> … … 90 87 </svg>Layout Style 91 88 </a> 92 <a class="nav-link font-weight-bold " id="md-settings-tab" data-toggle="pill" href="#md-settings" role="tab" aria-controls="md-settings" aria-selected="false">89 <a class="nav-link font-weight-bold " id="md-settings-tab" href="javascript:void(0)"> 93 90 <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16"> 94 91 <path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z" /> … … 108 105 <div class="md-accor-box"> 109 106 <div class="card-header" id="headingOne"> 110 <a class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> 111 <h5 class="mb-0">For user accounts and publications.</h5> 112 <i class="far fa-chevron-down"></i> 113 </a> 114 </div> 115 <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> 107 <h5>For user accounts and publications.</h5> 108 </div> 109 <div id="collapseOne" class="collapse show " aria-labelledby="headingOne" data-parent="#accordion"> 116 110 <div class="card-body"> 117 111 <p>To use this plugin on any page or post add shortcode with user handle.</p> … … 130 124 </div> 131 125 <div class="md-accor-box"> 132 <div class="card-header" id="headingTwo"> 133 <a class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> 134 <h5 class="mb-0">Advanced usage and customization</h5> 135 <i class="far fa-chevron-down"></i> 136 </a> 137 </div> 138 <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion"> 126 <div class="card-header" id="headingTwo"> 127 <h5>Advanced usage and customization</h5> 128 </div> 129 <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordion"> 139 130 <div class="card-body"> 140 131 <p>There are additional features that can be implemented using Medium Posts.</p> … … 384 375 ?> 385 376 <select class="custom-select form__field" id="inputGroupSelect04" name="mpost_date_format"> 386 <?php echo esc_attr($opt); ?>377 <?php echo $opt; ?> 387 378 </select> 388 379 <label for="mpost_date_format" class="form__label">Select Date Format</label> -
display-medium-stories/trunk/medium-post.php
r2832393 r2871683 4 4 * Plugin URI: https://devmontdigital.io/products/medium-plugin 5 5 * Description: This is custom made plugin use to get medium post on wordpress website 6 * Version: 7.4 6 * Version: 7.4.1 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 -
display-medium-stories/trunk/readme.txt
r2832393 r2871683 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.1 7 Stable tag: 7.4 7 Stable tag: 7.4.1 8 8 License: GPLv2 or later 9 9 10 Th eThis plugin is a powerful, professionally developed tool to show the medium stories in WordPress websites.10 This plugin is a powerful, professionally developed tool to show the medium stories in WordPress websites. 11 11 12 12 == Description == -
display-medium-stories/trunk/views/shortcode.php
r2832393 r2871683 105 105 $handle = $a['handle']; 106 106 $offset = $a['offset']; 107 $content = null; 108 // $medium_url = "https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/" . $handle; 109 // try { 110 // $ch = curl_init(); 111 // if (false === $ch) 112 // throw new Exception('failed to initialize'); 113 // curl_setopt($ch, CURLOPT_URL, $medium_url); 114 // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 115 // curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); 116 // $content = curl_exec($ch); 117 118 // if (false === $content) 119 // throw new Exception(curl_error($ch), curl_errno($ch)); 120 // } catch (Exception $e) { 121 // trigger_error( 122 // sprintf( 123 // 'Curl failed with error #%d: %s', 124 // $e->getCode(), 125 // $e->getMessage() 126 // ), 127 // ); 128 // } 129 $response = wp_remote_get( 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/' . $handle ); 130 $content = wp_remote_retrieve_body( $response ); 131 $items = array(); 132 $count = 1; 107 $content = null; 108 $response = wp_remote_get( 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/' . $handle ); 109 $content = wp_remote_retrieve_body( $response ); 110 $items = array(); 111 $count = 1; 133 112 134 113 … … 428 407 // Slider Design Three End 429 408 endif; 430 // echo esc_html__($html);431 // $aaa = esc_attr( $html ): string;432 // echo $aaa;433 // echo sanitize_html_class($html);434 409 echo apply_filters( 'esc_html', $html, $html); 435 // echo _wp_specialchars( $html);436 // echo wp_kses_post($html,'content');437 // echo apply_filters( 'attribute_escape', $html, $html );438 410 if (empty($items)) echo apply_filters( 'esc_html', "<div class='display-medium-no-post'>No posts foundss!</div>","<div class='display-medium-no-post'>No posts foundss!</div>"); 439 411 return ob_get_clean(); 440 412 } 441 413 add_shortcode('display-medium-article', 'devmont_medium_post'); 442 443 // function esc_attr( $text ) {444 // $safe_text = wp_check_invalid_utf8( $text );445 // $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );446 // /**447 // * Filters a string cleaned and escaped for output in an HTML attribute.448 // *449 // * Text passed to esc_attr() is stripped of invalid or special characters450 // * before output.451 // *452 // * @since 2.0.6453 // *454 // * @param string $safe_text The text after it has been escaped.455 // * @param string $text The text prior to being escaped.456 // */457 // return apply_filters( 'attribute_escape', $safe_text, $text );458 // }459 // apply_filters( 'attribute_escape', string $safe_text, string $text );460 ?>461 462
Note: See TracChangeset
for help on using the changeset viewer.