radgh
Forum Replies Created
-
Forum: Reviews
In reply to: [Advanced Custom Fields - Code Area Field] Does not work for HTMLHaven’t utilized this plugin yet but the solution to this problem is probably:
get_field( "mycode", get_the_ID(), false );
The third parameter (false) tells ACF not to format the value, just return the raw code. This lets the default textarea work with html, so I’d imagine it works for this plugin as well.
I don’t understand what your issue is, it sounds like you want to replace functionality of another plugin with Advanced Custom Fields. This largely depends on the other plugin, if it serializes the custom fields then ACF won’t be able to play along (and that’s not ACF’s fault).
If you want to learn how the custom fields are stored, which is using a randomly named “field_key”, then you should read the documentation about update_field:
https://www.advancedcustomfields.com/resources/update_field/
Forum: Reviews
In reply to: [jQuery Masonry Image Gallery] Looks good, but has some issuesI’ll add a star for your personal feedback. A lot of the issues you’ve faced make sense. It’s gotta be difficult trying to maintain not just your own plugin, but compatibility with other plugins too.
I’ve been hesitant to release plugins on www.ads-software.com because I don’t have the time to maintain them. I do work with WordPress a lot (themes and plugins), but it’s all closed source privately contracted stuff.
I don’t have the time or interest to work on your plugin right now, but maybe in the future when some projects launch. I do appreciate the work you have done, even though it wasn’t the best option for the project I was working on. I’ve given you a small donation to help the development.
If you want to, I would be interested in chatting about development or maybe contributing in the future when I have some more free time. Add me on skype if you want: radleygh
Scott, I haven’t tried their API to access properties directly but I can tell just by the terminology used that it’s a very involved process. If they had PHP functions like I was originally hoping for it would have been another story.
This is something you’ll need to hire a developer for unless you really want to get your feet wet and learn about using their API. I’m guessing it probably uses cURL and all sorts of stuff that you’ll need too.
So sorry, but it’s not something I can really give you any tips with.
we have an API that allows you to retrieve the agents active listing data and build your own slider layout, etc
Are you serious? I contacted support asking if this was possible and this was my response:
Q: Is it possible to get properties programatically with PHP, something like optima_express_get_properties(), and then get the property information returned in an array?
A: If you want to do advanced customization to existing features like gallery sliders or search forms, a lot of our clients do this kind of customization with CSS or by adding JavaScript injections to the end of pages which modify page elements to add, remove, or change HTML.
—
If I had known this was available it would have saved a lot of time (and a lot less hacky javascript code…). I would have never thought to look at “Web Service” for a PHP API.
At the very least the search results page for “PHP API” could put it up further on the page. At least before “How do I verify that Email Updates are being sent?”… come on!
Oh well, complaints aside I’m glad this feature actually does exist. That’ll earn an extra star at the very least. I guess your support team is only human and maybe they didn’t understand my question or they didn’t know about the “web services” feature.
Forum: Hacks
In reply to: Conditionally show custom widget in frontend sidebarHave you tried using the “
is_active_sidebar
” as a filter? It provides the sidebar index. With some effort you could get the widgets of the sidebar. If it only contains your widget, and is_single() is false, you could return false.Quite a lengthy process though.
If you are working with a theme, you can prevent your sidebar from being displayed if you buffer “
dynamic_sidebar()
“, then check the contents. Then you can check if any widgets actually rendered some HTML.I use this:
if ( is_dynamic_sidebar( $sidebar ) ) { ob_start(); dynamic_sidebar( $sidebar ); $sidebar_html = ob_get_clean(); if ( $sidebar_html ) { ?> <ul id="sidebar" class="sidebar-list"> <?php echo $sidebar_html ?> </ul> <!-- /#sidebar --> <?php } }
Forum: Hacks
In reply to: Publish a only single articleThe first two paragraphs are incredibly confusing.
It sounds like you want it so people can publish only one post. Is this correct?
You’ll want to use the
save_post
action hook. Get the current user withwp_get_current_user
. Check if the user has any published posts already withget_posts
(using post_author and post_status arguments).If
get_posts
returns any posts, they already have one published. If so, you still want to save the post, but you want to save it as draft and give the user a warning that they cannot publish it yet.Forum: Hacks
In reply to: Custom Post Type inside another Custom Post TypeI don’t think WordPress offers any built-in abliity to relate post types in this way. You can still use a separate post type (or taxonomy) as a means to handle data, then include items within your primary post type.
One way to think of this is default Galleries created with the “Add Media” button. Each image is an “attachment” post type, which can be added to your post. Galleries insert a list of IDs that reference each image.
You’ll want to use
wp_insert_post
to create new items, to get you started. You should only use post types if you actually want to utilize post types for their default behavior, such as editing them individually, viewing them on the front end, and adding them to menus.If you just want to store a list of title/text/image, it’s better to use an array. Custom post meta supports arrays.
Forum: Plugins
In reply to: [Options Framework] target="_blank" not working on hyperlinkI assume you are talking about a link that is entered in the “desc” field stripping tags from your HTML code.
I’ve run in to this problem myself, and it is difficult to deal with as there is a lack of action/filters to fix the problem.
The “desc” field is sanitized via wp_kses, allowing only tags in the global $allowedtags variable. Unfortunately this variable is very strict, and removes most attributes, including “target”.
This plugin should not sanitize the field at all. Why would you sanitize code that is hard coded into the script? Sanitize user input, not source code…!
Anyway, the code below should help. It temporarily replaces the $allowtags “whitelist” with a more lineant variant, $allowedposttags. Many more elements and attributes are trusted here, so you will have more freedom.
Just drop this code in to your functions.php file, then you can use the “target” attribute on your links. This code only runs on the options framework page. It starts when the page options framework section starts, and stops when options framework is done. So other plugins should not be affected.
function rad_of_add_better_kses() { add_action('optionsframework_after', 'rad_of_remove_better_kses'); // Will remove this hook when OF is done // Hold on to $allowedtags in another variable, temporarily replacing the original value while Options Framework is displaying the interface global $allowedtags, $allowedposttags, $rad_temp_allowedtags; $rad_temp_allowedtags = $allowedtags; $allowedtags = $allowedposttags; } function rad_of_remove_better_kses() { // Options framework is done displaying the interface, reset $allowedtags as to not interfere with other plugins. global $allowedtags, $rad_temp_allowedtags; $allowedtags = $rad_temp_allowedtags; } add_action('appearance_page_options-framework', 'rad_of_add_better_kses');
Forum: Plugins
In reply to: [Custom Metadata Manager] Uploading media, cannot insert into text boxI’ve built my own custom meta box instead. Still not sure why this method was broken, but the newer media browser works fine (and better).
Forum: Reviews
In reply to: [Simple Share Buttons Adder] Excellent PluginAh crap. This review was meant for another plugin (the names are quite similar!). I didn’t mean to troll. I did intend on leaving a very poor rating, just not for you!
Sorry about that. I’ll try and get this removed for you.
Edit: Wasn’t able to remove it, so I changed my vote. Sorry again!
Forum: Fixing WordPress
In reply to: Is there a way to pre-configure wordpress installs?I found this article about automating the install, although it is not as easy as I hoped, it would allow a single PHP script to be fired prior to the install (and I assume there’s a hook we can call after the install, too).
https://wpbits.wordpress.com/2007/08/10/automating-wordpress-customizations-the-installphp-way/
On the other hand, we can customize the install screen and perhaps add additional options, eg a checkbox to enable comments/pingbacks, or to start with permalinks enabled.
Then again, I don’t think anything I am planning on automating would require access before the installation – so a plugin should work as well. On the other hand, plugins are generally designed to be configured once they are installed – the exact opposite of what I want.
Maybe that install script is the best option. It’ll take a bit of work, though.
Forum: Fixing WordPress
In reply to: Custom Sidebars: 2 Sidebars, 2 different ID Tags?edit both files,
sidebar-custom.php:
change id=”sidebar” to id=”sidebar-left”sidebar-right.php:
change id=”sidebar” to id=”sidebar-right”The div tag is just a block-level container that doesn’t do anything. It’s not even part of wordpress.
Note that changing the ID will probably require you to modify your stylesheet, any reference to
#sidebar
needs to be updated for each sidebar.Forum: Reviews
In reply to: [User Meta Manager] It's not bad, but it could be a lot betterThe AJAX part is great, the animation is not. Hide/show does not animate by default either, they are instantaneous. Even if it were a fade in/out effect I would be pleased. The movement of the entire menu makes me sea sick.
Also, clientside validation can never be trusted, especially if it depends on browser support. Clientside validation is only necessary to keep the user on the page to immediately correct their errors (or prevent the error in the first place). I did not know about about the HTML5 regex support, however. That’s interesting. Still, with no serverside validation it’s easier to imagine there is no validation. You can easily change the HTML element with the browser console.
Anyway, sorry if I sounded a bit harsh. I have been going through many plugins similar to this one. None have met my expectations yet, although I guess I am looking for stock-wordpress quality in these sorts of things. And even then, customizing fields like this is not anywhere else in wordpress, so my expectations may not be entirely fair ??
Forum: Fixing WordPress
In reply to: Site very slow, can't figure out whyI suggest trying the P3 (Plugin Performance Profiler):
https://www.ads-software.com/extend/plugins/p3-profiler/Even if you do not suspect it to be a plugin, this will confirm your suspicion. Or, it may reveal the faulty plugin.