fireproofsocks
Forum Replies Created
-
Forum: Plugins
In reply to: [PHP Snippets] Not recognizing active licensePlease contact me via the contact form on craftsmancoding.com — forums are not an appropriate place for bug tracking. Include the site domain, your email, and the license key so I can look up the specifics.
Note that the pay-what-you-want licenses are limited to a single domain, so most frequently, users have reported problems when they move a site or launch a dev site (e.g. 123.0.0.7/~xzy) to a live site (e.g. http://xyz.com): the license is pegged to the domain. A new license key is required for each domain. This is partly by design and partly a limitation of the licensing software.
Forum: Plugins
In reply to: [PHP Snippets] Inserting SnippetI can’t debug someone else’s code for you, but it sounds like it might be a bit cleaner to modify your template instead of trying to add this as a snippet.
Forum: Plugins
In reply to: [PHP Snippets] Inserting SnippetDocumentation for the plugin is at https://code.google.com/p/wordpress-php-snippets/
I’m not sure what your “VRL_LISTINGS” is supposed to represent. If you’re getting a blank page, then that usually indicates a PHP error — so check your php logs or add this to your config file:
define('WP_DEBUG', true)I would recommend that you use a dedicated folder to store your snippets: using the site’s root web directory is a poor choice because you could potentially redundantly load up core WP files. The correct way to set this up is to use a sub-directory, and then properly reference the sub-directory in your Settings.
The bug tracker is the appropriate place for feature requests or bug reports. The forum is not a place where I devote hours of my time to come up with custom development solutions for every possible problem. If you want to discuss budgets and timelines so I can dedicate resources to fixing your problem, those conversations need to happen outside the forum (per WP rules).
From your gist, I’m not sure where $current_level is being set or what it’s being set as. You may want to use
print_r(get_custom_field_meta('item_type'));just to make sure the definition has the data you’re looking for.When working in loops, you can either work directly with WP’s get_post_meta functions (which do accept a post ID), or you can utilize the GetPostsQuery class (which I wrote specifically to avoid all the crazy caveats and limitations inherent in all of the built in WP querying functions/classes).
But remember: you’re doing 2 things. First, you’re wanting to get the actual values of custom fields from within a loop. Second, you’re wanting to get a default value of a defined custom field. That data comes from 2 very different places.
You can set a global post ID to get the functions to work (get_custom_field and print_custom_field), but it’s horrible architecture and leads to some unpredictable results, so I mention it only as a matter of fact.
Yes, this can be done. Keep in mind that the CCTM’s
get_custom_field()function (or the WPget_post_meta()function which it relies on) are pulling in values from the database for that post and field. You have noticed that these functions expect to be in the context of a post, so they are not easily used inside of a loop. I try to stay away from the mess that is global variables, but much of WP does not.If you want to get the default value for a dropdown (or any other field), then you need to see data from the field definition. That data exists separate from post data (e.g. you can have a default value for a field even if you have never used that field on any posts).
See the
get_custom_field_meta()function (or the print counterpart): https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_custom_field_metaSpecifically, you’d want to do something like this:
<?php print_custom_field('your_field', 'default_value'); ?>Hope that helps. I’m working on a massive update to the plugin.
Forum: Plugins
In reply to: [PHP Snippets] New Version of plugin hanging browserI’m not sure what would cause that behavior, but it’s possible that the new version (1.1) resolves problems with Ajax.
Forum: Plugins
In reply to: [PHP Snippets] Not recognizing active licenseYou may also want to try deactivating the plugin and reactivating it.
Forum: Plugins
In reply to: [PHP Snippets] Not recognizing active licenseYou might be hitting a limit for the number of sites allowed per license. Send me your email via the contact form on https://craftsmancoding.com/
Forum: Plugins
In reply to: [PHP Snippets] Update broke my site. Need to pay to restore it.Yes, I realize that wasn’t the smoothest way to do this, and I will make sure to do it smoother in the future, but again, doing this within the confines of WordPress is not easy.
Forum: Plugins
In reply to: [PHP Snippets] Update broke my site. Need to pay to restore it.Sorry you feel that way. This is a “pay what you want” plugin, including $0, so “extortion” is a pretty strong word when you’re not forced to pay anything at all. Development takes time and so does monitoring the forums, so I asked users to contribute what they feel is fair given how useful they find the plugin and their economic situation. I am sorry that upgrading breaks your site — it is possible to get a license key before upgrading. I should have tried to make that process smoother, but given WordPress’ limitations and the nature of upgrading, it’s difficult to completely avoid the bumps.
Forum: Plugins
In reply to: [PHP Snippets] Php snipets directory warningIs it possible your host has disabled the “is_dir” or other functions? Has this plugin worked on your site before?
A test might be:
<?php if (!function_exists('is_dir')) { print "Yikes... PHP Snippets cannot run"; }Forum: Plugins
In reply to: [PHP Snippets] Php snipets directory warningI don’t think your full path is going to start with /web, even if you were on a dedicated server. Please double-check the path for the directory you are trying to use. See https://code.google.com/p/wordpress-php-snippets/
What version of the plugin are you using?
Forum: Plugins
In reply to: [PHP Snippets] Php snipets directory warningThat doesn’t look like the complete error message, and it doesn’t look like a valid path, so I can’t say for sure. However, Check the Settings –> PHP Snippets page and verify that you’ve entered a valid directory. I recommend using the [+ABSPATH+] placeholder when you define your paths: it is a special code to represent the root directory of your WordPress installation. Use the “Show Snippets” button on that page to list valid snippets: it’s an excellent way to test whether or not you’ve configured the correct paths.