ivantedja
Forum Replies Created
-
can you post the AJAX response when trying to click “save & publish” ?
Forum: Hacks
In reply to: Update progress bar from databaseif
update_option('aou_progress','0');
is located in your main plugin file then it gonna be a problem
because any request to your server (refreshing page, ajax call, etc) will trigger that method call
which means it will always resetaou_progess
value into 0
you might need to put additional logic for thatanother thing to be noted is: CURLOPT_PROGRESSFUNCTION
check this out: https://php.net/manual/en/function.curl-setopt.php#116866for PHP version < 5.5.0, CURLOPT_PROGRESSFUNCTION pass 4 arguments
and for PHP version >= 5.5.0, CURLOPT_PROGRESSFUNCTION pass 5 arguments
which means it may break without version checkingyou also need to be careful with CURLOPT_PROGRESSFUNCTION
because it is a callback function which run separately and standalone
which means a second call toprogressCallback
can not recognize previous state fromprogressCallback
at the first time
so you just need to be aware of$upload_size
and$uploaded_size
($previousProgress
is unused)then the last thing is, it may not 100% reflect your current progress because it is a race between:
– callback from CURLOPT_PROGRESSFUNCTION
– and your AJAX underwindow.setInterval
the progress bar might work for a large file size upload but it may “not work” for a small file size upload
“not work” -> because CURLOPT_PROGRESSFUNCTION might already reach 100% before your AJAX call had a chance to update the progress bar graduallyForum: Fixing WordPress
In reply to: featured image caption breaks website with new updateYeah, the_post_thumbnail_caption() is introduced since 4.6.0
Most likely blank / white page is happened because of PHP Fatal ErrorIt depends on you configuration, usually the first thing to do is to:
1. if you are on debug mode and debug log is on
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
check your WordPress’ debug.log2. if you are not on debug mode then check you server’s error log (need to make sure you turned it on in your server’s configuration)
The error message is pretty clear:
[22-Aug-2016 05:12:48 UTC] PHP Fatal error: Cannot redeclare the_post_thumbnail_caption() (previously declared in /somewhere/wp-includes/post-thumbnail-template.php:244) in /somewhere/wp-content/themes/twentysixteen/functions.php on line 453
Forum: Hacks
In reply to: Mulltiple shortcodes on same pagedocument.sub_but
will retrieve element with namesub_but
when you are only using one short code,
document.sub_but
will return:<img src="photo1" style="width:250px; height:250px; border:0px solid #cc3300;" alt="Move your mouse over me" name="sub_but">
whereas when there are two short codes,
document.sub_but
will return an array:[ <img src=?"photo1" style=?"width:?250px;? height:?250px;? border:?0px solid #cc3300;?" alt=?"Move your mouse over me" name=?"sub_but">? , <img src=?"photo2" style=?"width:?250px;? height:?250px;? border:?0px solid #cc3300;?" alt=?"Move your mouse over me" name=?"sub_but">? ]
which makes
document.sub_but.src
invalidmy suggestion is to change that into:
this.getElementsByTagName('img')[0].src
this
-> means<a>
element
getElementsByTagName('img')[0]
-> retrieve the first<img>
element relative from<a>