Posts by Matyushen

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says


Do I have to sign in to another account, purchase my own theme and then test the API key from that account? Is that the only way?
Yes. And while you’re at it, give yourself a five star rating. You deserve it! :)

:bigsmile:

And what about this one by Codestag? https://github.com/codestag/stag-envato-updater

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says



Theme updates: https://github.com/bitfade/themeforest-themes-update

Is there any way to define username and api key not from wp-config, but from the theme?

Of course. In functions.php…

require_once( 'pixelentity-theme-update/class-pixelentity-theme-update.php' );
PixelentityThemeUpdate::init( 'USER', 'API_KEY', 'THEME_AUTHOR' );

Thank you!

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

Theme updates: https://github.com/bitfade/themeforest-themes-update

Is there any way to define username and api key not from wp-config, but from the theme?


Plugin updates: http://themeforest.net/forums/thread/modified-tgm-plugin-added-option-to-update-the-plugins/105830

Thanks for the link, definitely will try it

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

What is the best practice to incorporate automatic update functionality into themes? Envato WordPress Toolkit? looks a bit outdated and not supported. It also slows down the dashboard pretty noticeable. Should we use it in our themes? Is there any good alternative which fits the requirements of the marketplace? As I understand the theme must be updated only from themeforest itself, because the update must be first reviewed and accepted, right? It drops solutions like Github Updater from a private repo out of the game. And how do you provide updates for the plugins included in your themes? Should they also be uploaded with the theme & reviewed & and then updated? I’m speaking about own custom plugins, like portfolio, shortcodes & similar. Would be great to hear how you authors deal with this.

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says


This code is no longer accepted by reviewers:
add_filter('the_content', 'shortcode_empty_paragraph_fix');
function shortcode_empty_paragraph_fix($content)
{   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );

    $content = strtr($content, $array);

    return $content;
}
What do you guys use instead of it?

We use this instead this little nifty function thanks to bitfade:

https://gist.github.com/bitfade/4555047

This is used because you are only using on your shortcodes so that any 3rd party shortcodes are not affected by this which is why the other code is not allowed, because it also effects 3rd party plugins.

Thanks for the link :)

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says


Yeh, I’ve put it twice by mistake, sorry :) But it doesn’t change anything. Debug mode has nothing to say and no class has been added to the image links.

you asked about the error, so you got the answer… ;)

The image_send_to_editor filter runs inside the get_image_send_to_editor function which is resposible for sending the link HTML that surrounds images sent to the editor.

So, this filter runs when you insert image using Media Uploader to the editor. You need to try to add/edit your post and try to insert an image. So, it doesn’t applied to your existing images in your existing posts (if this is what you asked).

Brilliant! Thanks for your help, now I understand how dumb my question was ;)

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

Yeh, I’ve put it twice by mistake, sorry :) But it doesn’t change anything. Debug mode has nothing to say and no class has been added to the image links.

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

Not sure if it’s ok to post such question here, sorry if it’s not. I need to set a class to all links around self hosted images embedded to posts/pages, only to images from the upload directory, not to external ones. For lightbox purposes. I’ve found one solution here. Looks like it’s exactly what I need, except it doesn’t work – Fatal error: Cannot redeclare add_colorbox_class_to_image_links() Any thoughts? Thanks!

function add_colorbox_class_to_image_links($html, $attachment_id, $attachment) {
$linkptrn = "/<a>]*>/";
$found = preg_match($linkptrn, $html, $a_elem);

// If no link, do nothing
if($found <= 0) return $html;

$a_elem = $a_elem[0];

// Check to see if the link is to an uploaded image
$is_attachment_link = strstr($a_elem, "wp-content/uploads/");

// If link is to external resource, do nothing
if($is_attachment_link === FALSE) return $html;

if(strstr($a_elem, "class=\"") !== FALSE){ // If link already has class defined inject it to attribute
    $a_elem_new = str_replace("class=\"", "class=\"colorbox ", $a_elem);
    $html = str_replace($a_elem, $a_elem_new, $html);
}else{ // If no class defined, just add class attribute
    $html = str_replace("</a><a class="\"colorbox\""></a>
11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

So, if there any proved solution for this? Last mentioned solution does not work at all for some reason. Get this:

Warning: preg_replace() [function.preg-replace]: Unknown modifier '>'
Warning: preg_replace() [function.preg-replace]: Unknown modifier 'p'

Only this does the trick:

add_filter('the_content', 'shortcode_empty_paragraph_fix');
    function shortcode_empty_paragraph_fix($content) {   
      $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
      );
      $content = strtr($content, $array);
      return $content;
    }

But some tell it wont get through. Could anybody recommend any solution for clearing few shrotcodes from p and br tags? Thanks!

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says


“Modification of filters in wpautop is not allowed.” Does that mean I can’t change wpautop priority? Like this:
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop', 12);

Probably…

But you can do this (ugh…) instead:

function prevent_autop_shortcodes( $content ) {
    return strtr( $content, array(  '<p>[' => '[', ']</p>' => ']', ']<br />' => ']' ) );
}
add_filter( 'the_content', 'prevent_autop_shortcodes' );
Yeah… It’s ugly.

Thanks, came up with this also, so far the best solution, but far from ideal.

by
by
by
by
by
by