How to print custom field value inside shortcode WordPress

I’m trying to print a Custom field value inside the shortcode I have, I tried the following code but it’s not working for me … what’s i can do to make it print the value ?

     ""?''.get_field('download_link').'':"");" target="_blank" bg_color="#1e73be" txt_color="#FFFFFF" icon="fa-file-pdf-o" icon_type="fa" nofollow="1"]'); ?>

Note: The Value i want to print inside the url Attribute

All topic

Not able to prepopulate inputtext field on VF page

I have this controller, and I am trying to prepopulate inputext field with the string I am building in my controller. If i set my return statement to ‘John’, my field gets populated with that value, but for some reason if I reference emailbody string, nothing gets populated. Could anyone provide any guidence please?

    public class LTRORequireAdditionalDocumentsCon {
        public String emailBody;// {get; set;}
        public String getemailBody(){return emailBody;}

      public void setemailBody(String emailBody){
            this.emailBody = emailBody;
     }

    public PageReference previewEmail(){
            String docsString = '';
            String[] strList = new String[0];
            for(LTRO_Document__c docs: ltrodoclist){
                strList.add(String.valueOf(docs));
                docsString += 'Document : '+ docs.type__c + 'n 
'+ ' Notes : ' + docs.Summary__c + 'n
n
' ; } //build the email template emailBody = 'We have identified that additional documents are required :
' + docsString +'
Please provide the needed information.
' PageReference reviewEmailPage = new PageReference('/apex/LTRORequireAddDocEmailReview'); reviewEmailPage.setRedirect(true); return reviewEmailPage; }

And this VF Page:


        
          

            









All topic

WP_Query : Search and Filter Using custom field AND/OR custom taxonomy

I’ve not been able to find my way using the existing answers; hence decided to post a new question anyway. What I want to achieve has probably been done 20,000 times; but I might just be an idiot. Anyway –

What I have:
1. Custom Post Type: ‘job’
2. Each ‘job’ has: custom_filed_1: location , custom_field_2: company
3. It also has: custom_taxonomy_1: skills, custom_taxonomy_2: disciplines

For the life of me, I can’t figure out how to write WP_QUERY that will help me retrieve posts that have: custom_field_1 AND custom_taxonomy_1 AND custom_taxonomy_2.

Like searching for jobs available in “New York” AND Skills “PHP + WordPress” AND available for “Computer Science Engineers”.

My main confusion is how do I have ‘AND’ / ‘OR’ relationship between ‘meta_query’ and ‘tax_query’ arguments of WP_Query.

Would really appreciate your help. Thanks!

Here’s my sample code:

    $args = array(
    'post_type' => array('job'),
    'post_status' => array('publish'),
    'posts_per_page' => '5',

     'meta_query' => array(
          'relation' => 'AND',
           array(
               'key' => 'location',
               'value' => $search_location, 
               'compare' => 'LIKE',
               ),
          array(
               'key' => 'company',
               'value' => $search_company, 
               'compare' => 'LIKE',
               ),     
        ),
     'tax_query' => array(
        'relation' => 'AND',
         array(
          'taxonomy' => 'skills',
          'field'    => 'slug', 
          'terms'    => $search_skills,
          'operator' => 'IN'
         ),
        array(
                 'taxonomy' => 'disciplines',
          'field'    => 'slug', 
          'terms'    => $search_disciplines,
          'operator' => 'IN'
),
    );

All topic

Excel pivot: Cannot group a date field coming from Access

It seems I can’t group date in a pivot table where the data comes from Access. I made sure that the date field is never empty.
I made several tests using Excel 2013 and Access 2013 nwind.accdb.
In the end it looks like if I define ONE table (Orders) as the source, I CAN group, but if I use 2 tables (Orders and Order Details) grouping is disabled (greyed).
Could someone confirm or give me a hint or a workaround ?
Note: to connect from Excel to Acccess accdb, I used Ace oledb 15.

All topic

Move camera depth of field from background to magnifier on the foreground

I have a shot here where I would like to move the focus from the background to the magnifier on the foreground.

Maybe I’m wrong here, but tell me, when the focus is on the foreground, the reflection on the magnifier (the zoomed image) should be sharper, no ?
Because on my example below, the reflection is as blurred as the background.

Am I doing something wrong ?

enter image description here

Thanks

All topic

Formula field not evaluated in trigger.new in test class only

I am writing a test class for a trigger (after update in this case), and while the code works on my person account record page when I inline edit, it does not work in my test class when I manually change the field that would re-evaluate the formula to true/false. The problem it seems is that the formula field does not get evaulated in Trigger.New while I’m executing the test class. here’s where the code breaks:

Trigger code – this is where I get different results in inline vs. test class change. Enrolled_Within_Past_Year__pc is the formula field:

if(triggerNew.get(i).Enrolled_Within_Past_Year__pc != triggerOld.get(i).Enrolled_Within_Past_Year__pc){
 ....
 }

All topic

Do magic items lose their magical durability in an Antimagic field

The DMG says this about magic item durability:

Most magic items are objects of extraordinary craftsmanship. Thanks to a combination of careful crafting and magical reinforcement, a magic item is at least as durable as a nonmagical item of its kind. Most magic items, other than potions and scrolls, have resistance to all damage. Artifacts are practically indestructible, requiring extraordinary measures to destroy.

Antimagic Field’s interaction with magic items is defined as such:

The properties and powers of Magic Items are suppressed in the Sphere. For example, a +1 long sword in the Sphere functions as a nonmagical long sword.

So would an Antimagic field suppress the damage resistance of magic items, allowing them to be destroyed more easily? If this is true then destroying artifacts would be trivial with a high-level caster.

All topic

Remove special characters from input field

I’ve been searching everywhere but have been unable to find exactly what I am looking for.

I have an html for that is filled out with Mac addresses from our inventory so.thr strings inputted into the input field will look like:

A1:A2:A3:A4:A5:A6

I’m trying to write a script to remove the : character plus any spaces anywhere. That way when it is entered the output will be:

A1A2A3A4A5A6

This is what I have so far:


Then in my script I have:

function removeChar() {
var a = document.getElementById("macaddress").value;
a = a.replace(/: /g, '');
document.getElementById.innerHTML = a;
}

I don’t get any JavaScript errors with this but nothing happens.

I also have another script that pulls the value of the field into a work log which is the other function WriteLog().

Essentially I want to remove the : then have the new value pulled into the log by the second function.

All topic

Django JSON field in forms

here’s my problem.I’m trying to create product variants which contain attribute values of the selected product. I’m trying to use JSONField to do that but I was wondering how I could dynamically display the fields in the form for creating new product variants.

Here is my models.py file:

class Product(models.Model) :
    name = models.CharField(max_length=120)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    image = models.ImageField(upload_to='products')
    allow_variants = models.BooleanField(default=True)
    product_attributes = models.ManyToManyField("attribute")

    def __str__(self) :
        return self.name

    class Meta :
        ordering = ("name",)

class Attribute(models.Model) :
    name = models.CharField(max_length=120)

    def __str__(self) :
        return self.name

    def get_all_attr_variants(self) :
        variants = AttributeVariant.objects.filter(attribute__name=self.name)
        return variants

class AttributeVariant(models.Model) :
    name = models.CharField(max_length=120)
    attribute = models.ForeignKey(Attribute, on_delete=models.CASCADE)

    def __str__(self) :
        return self.name

    class Meta :
        ordering = ('name',)

class ProductVariant(models.Model) :
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    name = models.CharField(max_length=120)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    attributes = JSONField()

    def __str__(self) :
        return self.product.name + ": " + self.name

    class Meta :
        ordering = ("product.name", "name")

Please help me if you have any idea of how I could solve this problem!
Thanks

All topic

Is cosmological constant some kind of field that permeates all of space?

One simplest candidate for dark energy is a cosmological constant.

Is cosmological constant some kind of field that permeates all of space?

There are four types of fields : scalar,vector,spinor,tensor. If cosmological constant is a field, does it have to fit in these types of fields?

All topic