Yea. get_posts is fine for.

Hadson: Sexywoodenspoon: got a link to the page in question?

Jeng: Rounds: if you’re using ACF, you can use get_field to get a field’s value

Wescovich: Scavotto: Nah – local dev. I’ll paste bin what I mean in 2 secs

Odriscoll: Its a Field Group level setting under Screen Options

Eggink: Sexywoodenspoon: dont think I need a pastebin of the results. I understand what th results are. If given the page I would look at the source for anything that could be applying an inline size like some javascript

Frisby: I have a wordpress site where I allow users to download various admin created content based on their roles. The problem is that that if one user gets the link to the file they can give it to another user to download. Is there a way in WordPress to deny direct access to a file unless some condition is met i.e. role = admin?

Schessler: Jstransky: Jeng: how do I learn the proper name for the page 2nd parameter to get_field?

Rabold: Sexywoodenspoon: maybe your syntax is wrong on the shortcode. when you enter width and heght are you including px ?

Tenley: I’m not disagreeing with Scavotto, the native approach is always ultimately better but we’ve built some pretty major sites based on ACF and only had a handful of issues to work around.

Fiscus: It doesn’t seem to be the title of the ACF page.

Bongiardina: Aphpperson: sure. you just do ifis_role’admin’ { link to file }

Jeng: Rounds: “$post_id: Specific post ID where your value was entered. Defaults to current post ID not required. This can also be options / taxonomies / users / etc”

Ronin: Open the field group containing that field in your admin, click screen options on the top right

Llanes: Jstransky: I’m not claiming good things can’t be built with ACF. I just personally dont like the level of obfuscation of data in the DB/

Jeng: If you’re in the loop, you don’t need it for a field that’s part of the current post

Zickefoose: Scavotto: thanks but it’s not javascript that’s overriding it. Syntax is definitely correct.

Tanzi: Jeng: so the post= portion of the URL should do it, right?

Drehmer: Jstransky: it also makes debugging more difficult with the community as a whole using a 3rd party system for EVERYTHING

Jeng: Why are you looking at the URL?

Galipeau: Scavotto: yep, that would stop the link from showing up on the page. Is there something that would stop them from being able to access the file by directly going to mysite/uploads/file.ext?

Seniff: Scavotto: No doubt. It’s not a first cl*** citizen of wordpress and that gaurantees inherent issues. But as plugins go, I get a lot of bang for my buck

Ahlheim: Jeng: maybe I’m approaching this un-idiomatically, then. I use get_posts and then a foreach through them

Guardiola: Aphpperson: you can do some fancy rewrites where the only real link to the file is a custom rewrite rule which you can possibly set only for certain user roles

Zieler: Aphpperson: this way the user never actually sees the direct path to the image file

Jeng: You should be using wp_query, not get_posts. Anyway, if you have a post object you have the current post id.

Milliren: Aphpperson: therfore they can ONLY link to the rewrite path

Jeng: Rounds: I ***ume you’re in the loop.

Presgraves: Jeng: this is a function in functions.php, hooked on init at the moment

Calixtro: And if in the loop, I use the ‘name’ of the field

Gaufin: Jeng: hes just doing it as a one off script to grab posts, change them up, and resave. Doesnt HAVE to be WP_Query

Antila: Its not a front end loop

Jeng: Ok. I was about to ask for the code. Rounds: if you have a post object, you can get the post ID from it.

Hoerger: Scavotto: that sounds awesome! Do you have a reference to any sort of do***entation that might help me build something like that?

Hayter: Yea. get_posts is fine for what he’s doing as it only gets an array of posts and that’s it. which is perfectly fine because its all ge needs