| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/ict/wp-content/plugins/so-widgets-bundle/base/inc/fields/js/ |
Upload File : |
/* global jQuery, soWidgets, sowbForms */
( function( $ ) {
$( document ).on( 'sowsetupform', '.siteorigin-widget-field-type-posts', function( e ) {
var $postsField = $( this );
$postsField.on( 'change', function( event ) {
var postsValues = sowbForms.getWidgetFormValues( $postsField );
var queryObj = postsValues.hasOwnProperty( 'posts' ) ? postsValues.posts : null;
var query = '';
for ( var key in queryObj ) {
if ( query !== '' ) {
query += '&';
}
query += key + '=' + queryObj[ key ];
}
$.post(
soWidgets.ajaxurl,
{ action: 'sow_get_posts_count', query: query },
function( data ) {
$postsField.find( '.sow-current-count' ).text( data.posts_count );
}
);
} );
} );
} )( jQuery );