Posts by partnuz

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

This is slightly modified code from SMOF 1.5.2 I use to add upload fields to wordpress widgets

function adwf_add_file(event, selector) {

    var upload = jQuery(".uploaded-file"), frame;
    var jQueryel = jQuery(this);

    event.preventDefault();

    // If the media frame already exists, reopen it.
    if ( frame ) {
        frame.open();
        return;
    }

    // Create the media frame.
    frame = wp.media({
        // Set the title of the modal.
        title: jQueryel.data('choose'),
        /* add this in future
        frame: 'post',
        */

        // Customize the submit button.
        button: {
            // Set the text of the button.
            text: jQueryel.data('update'),
            // Tell the button not to close the modal, since we're
            // going to refresh the page when the image is selected.
            close: false
        }
    });

    // When an image is selected, run a callback.
    frame.on( 'select', function() {
        // Grab the selected attachment.
        var attachment = frame.state().get('selection').first();
        frame.close();
        selector.find('.upload').val(attachment.attributes.url);
        if ( attachment.attributes.type == 'image' ) {
            selector.find('.screenshot').empty().hide().append('<img class="of-option-image" src="' + attachment.attributes.url + '" />').slideDown('fast');
        }
        selector.find('.media_upload_button').unbind();
        selector.find('.remove-image').show().removeClass('hide');//show "Remove" button
        adwf_file_bindings();
    });

    // Finally, open the modal.
    frame.open();
}

function adwf_remove_file(selector) {
    selector.find('.remove-image').hide().addClass('hide');//hide "Remove" button
    selector.find('.upload').val('');
    selector.find('.screenshot').slideUp();
    /* selector.find('.remove-file').unbind(); */
    adwf_file_bindings();
}

function adwf_file_bindings() {
    jQuery('.remove-image').on('click', function() {
        adwf_remove_file( jQuery(this).parents('.adwf_upload') );
    });

    jQuery('.media_upload_button').unbind('click').click( function( event ) {
        adwf_add_file(event, jQuery(this).parents('.adwf_upload'));
    });
}

jQuery(document).ready(function($){

    adwf_file_bindings();

});
152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

absolutely superb job

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

I think it has something to do with West embargo directed for Russia. Otherwise I see no reasonable explanation :)

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

Hi Thomas

Thanks for the great work, but it doesn’t seem to work like it should. If one of the plugins is out of date i simply get the notice. But there is no option for the user to update the plugin.

This is how it currently looks:

This is how Stefan’s version looks:

You’ll see the difference. With your version i do get the notice, but there’s absolutely no way to update the plugin.

It doesn’t have this option. I asked the author some time ago and he replied few days ago https://github.com/thomasgriffin/TGM-Plugin-Activation/issues/163

@hogash perhaps you could create your version but instead of modifying core file you could use OOP inheritance. For example

class Original{ code… }

class Yours extends Original{ overwrite few functions }

This way it would be much easier to allow other developers to improve your code.

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

change your array to this

array( ‘fa-adjust’ => ‘fa-adjust’, ‘fa-adn’ => ‘fa-adn’ )

It seems that you don’t provide keys to select field.

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

Maybe combining bitfade gist and using it inside shortcode should be better solution.

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

I’m quite sure I’ve figured this out. Check this https://gist.github.com/partnuz/9175420 and tell me if there are any errors.

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

I recently played - daisy - ultimate stuntman - micro machines

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

I personally dislike Visual Composer. I do like the RAD – http://vimeo.com/72519618 (which isn’t available as a separate plugin or function unfortunately).

Why is that ?

152 posts
  • Exclusive Author
  • Has been a member for 5-6 years
partnuz says

APB is not longer maintained I suppose. From what I can tell it has some bugs in UI but it’s quite easy to adapt to one’s needs.

by
by
by
by
by
by